feat(api): update API spec from langfuse/langfuse 966662e #726
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.
Important
This PR adds a
CORRECTIONscore type and dataset versioning to the API, allowing correction feedback storage and temporal dataset queries.CORRECTIONscore type toScoreandGetScoresResponseDataunions, allowing correction feedback storage.versionparameter inDatasetManager.get()andDatasetItems.list()for temporal queries.CorrectionScoreinterface inCorrectionScore.tswithvalueandstringValueproperties.Score.tsandGetScoresResponseData.tsto includeCorrectionvariant.Client.tsindatasetItemsanddatasetRunItemsto supportversionparameter.datasetVersionfield inCreateDatasetRunItemRequest.tsfor specifying dataset version in runs.datasets.e2e.test.tsto verify dataset versioning functionality.This description was created by
for 4d453cd. You can customize this summary. It will automatically update as commits are pushed.
Disclaimer: Experimental PR review
Greptile Overview
Greptile Summary
This PR updates the API specification from the main Langfuse repository, introducing two key features:
1. Correction Score Type: Adds a new
CORRECTIONdata type to the scoring system, allowing users to store correction feedback alongside numeric, categorical, and boolean scores. TheCorrectionScoreinterface includes both a numericvalue(always 0) and astringValuefor the correction content.2. Dataset Versioning: Introduces temporal query support for datasets via an optional
versionparameter (ISO 8601 timestamp). Users can now:All changes follow the existing code patterns and maintain backward compatibility through optional parameters. The code is auto-generated via Fern from the API definition.
Confidence Score: 5/5
Important Files Changed
CorrectionScoreinterface extendingBaseScorewithvalueandstringValuepropertiesCorrectionvariant toScorediscriminated union withdataType: "CORRECTION"versionparameter to dataset items list endpoint for temporal queriesdatasetVersionfield for specifying dataset version in experiment runsCorrectionvariant toGetScoresResponseDatadiscriminated unionSequence Diagram
sequenceDiagram participant Client participant DatasetItemsAPI participant DatasetRunItemsAPI participant ScoreV2API Note over Client,ScoreV2API: New Correction Score Support Client->>ScoreV2API: Request scores ScoreV2API-->>Client: Return scores (Numeric/Categorical/Boolean/Correction) Note over Client,DatasetItemsAPI: Dataset Versioning Client->>DatasetItemsAPI: Get dataset items (with version param) DatasetItemsAPI-->>Client: Return items at specified timestamp Client->>DatasetRunItemsAPI: Create dataset run item (with datasetVersion) DatasetRunItemsAPI-->>Client: Return run item with version snapshot