feat(api): update API spec from langfuse/langfuse 966662e#1508
Open
langfuse-bot wants to merge 1 commit intomainfrom
Open
feat(api): update API spec from langfuse/langfuse 966662e#1508langfuse-bot wants to merge 1 commit intomainfrom
langfuse-bot wants to merge 1 commit intomainfrom
Conversation
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.
Important
This PR adds a new
CorrectionScoretype, updates dataset item handling for versioning, and integrates the new score type into the API.CorrectionScoreincorrection_score.py.Score_Correctiontoscore.pyandGetScoresResponseData_Correctiontoget_scores_response_data.py.DatasetItemsClientindataset_items/client.pyto support versioned dataset retrieval.dataset_versiontoCreateDatasetRunItemRequestincreate_dataset_run_item_request.py.__all__lists in__init__.pyfiles acrosscommons,score_v_2, andtypesdirectories to include new score types.GetScoresResponseDataCorrectioninget_scores_response_data_correction.pyto extendCorrectionScore.This description was created by
for c2dd867. 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 Python SDK API specification from the upstream Langfuse repository (commit 966662e), adding two major features:
1. Correction Score Type
CORRECTIONscore data type alongside existing NUMERIC, CATEGORICAL, and BOOLEAN typesCorrectionScoreclass extendingBaseScorewithvalue(always 0) andstringValuefieldsScore_CorrectionandGetScoresResponseData_Correctionvariants to union types2. Dataset Versioning
versionparameter toDatasetItemsClient.list()method to retrieve dataset items at a specific point in timedatasetVersionfield toCreateDatasetRunItemRequestto pin experiment runs to specific dataset versionsThe changes are auto-generated by Fern from the API definition, ensuring consistency with the backend API. All modified files follow established patterns for Pydantic models, client methods, and type unions. The changes are purely additive—no existing functionality is removed or modified.
Confidence Score: 5/5
Important Files Changed
BaseScorewithvalue(float) andstringValuefieldsScore_Correctionvariant to theScoreunion type with CORRECTION data typeversionparameter tolist()method for point-in-time dataset item retrievaldatasetVersiontimestamp field to specify dataset version for experiment runsCorrectionScorewith optional trace dataSequence Diagram
sequenceDiagram participant Client participant DatasetItemsAPI participant ScoreAPI participant Database Note over Client,Database: New Correction Score Feature Client->>ScoreAPI: Create/Get Score (with CORRECTION type) ScoreAPI->>Database: Store/Retrieve CorrectionScore Database-->>ScoreAPI: Return correction with value=0, stringValue ScoreAPI-->>Client: Return Score_Correction Note over Client,Database: Dataset Versioning Feature Client->>DatasetItemsAPI: list(version="2026-01-21T14:35:42Z") DatasetItemsAPI->>Database: Query items at timestamp Database-->>DatasetItemsAPI: Return historical dataset items DatasetItemsAPI-->>Client: PaginatedDatasetItems Client->>DatasetItemsAPI: create_dataset_run_item(datasetVersion="2026-01-21T14:35:42Z") DatasetItemsAPI->>Database: Link run to dataset version Database-->>DatasetItemsAPI: Confirm run created DatasetItemsAPI-->>Client: Dataset run item created