Chore report evals as experiments in langfuse#254
Open
valdis wants to merge 3 commits into
Open
Conversation
…ve switch The openai-compatible case used a raw string literal instead of the enum constant, bypassing the never check in the default branch. Adding OPENAI_COMPATIBLE to AIProviderType and using it in the switch restores exhaustiveness — adding a new AIProviderName will now cause a compile error if the factory switch is not updated.
Each dataset run item now carries runDescription and run-level metadata (model, mode, provider, preset, configPath) so Langfuse shows meaningful experiment context alongside each run — not just the auto-generated name. The SDK upserts these fields on the dataset run object on every call, so the metadata is consistent across all items in the same run.
Replace `langfuse@3.38.20` with `@langfuse/client@5.4.1` across the eval pipeline. Key changes: - `Langfuse` → `LangfuseClient` everywhere - `langfuse.score()` → `langfuse.score.create()` - `langfuse.shutdownAsync()` → `langfuse.shutdown()` - `langfuse.api.datasetsGet()` + manual pagination → `langfuse.dataset.get()` (auto-paginated) - `langfuse.api.datasetRunItemsCreate()` → `langfuse.api.datasetRunItems.create()` - `langfuse.api.datasetsCreate()` → `langfuse.api.datasets.create()` - `langfuse.api.datasetItemsCreate()` → `langfuse.api.datasetItems.create()`
15f4b79 to
0274b45
Compare
QualOps Code Quality AnalysisStatus: ✅ PASSED - No issues found Summary
No issues found in the analyzed code. 📊 Full ReportPowered by QualOps |
sebastianwessel
approved these changes
Jun 18, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR does two unrelated but both welcome things:
Langfuse SDK upgrade (langfuse@3 → @langfuse/client@5.4.1)
The v5 client ships a structured resource API (langfuse.api.datasetRunItems.create, langfuse.dataset.get, langfuse.score.create, etc.) instead of the flat method surface of v3. The migration is mechanical — every call site is updated to the new namespaced path, and the manual pagination loop for datasetItemsList is replaced by langfuse.dataset.get() which returns items directly.
The key functional addition: datasetRunItems.create now includes runDescription (model · mode · preset) and a richer metadata payload, so each eval run is properly registered as a Langfuse experiment with enough context to distinguish runs in the UI without needing to click into individual traces.