feat(api): update API spec from langfuse/langfuse b9162bf #1506
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
Add
CorrectionScoretype and integrate it into the API, updating relevant classes and unions.CorrectionScoreclass incorrection_score.py.Score_Correctionclass inscore.py.GetScoresResponseDataCorrectionclass inget_scores_response_data_correction.py.Scoreunion inscore.pyto includeScore_Correction.GetScoresResponseDataunion inget_scores_response_data.pyto includeGetScoresResponseData_Correction.CorrectionScoreto imports and__all__in__init__.pyfiles incommons,score_v_2, andtypesdirectories.GetScoresResponseDataCorrectionto imports and__all__inscore_v_2andtypesdirectories.This description was created by
for a67aea8. You can customize this summary. It will automatically update as commits are pushed.
Disclaimer: Experimental PR review
Greptile Overview
Greptile Summary
This PR adds support for a new "correction" score type to the Langfuse Python SDK by updating the auto-generated API client code.
CorrectionScorebase class extendingBaseScorewithvalue(float) andstring_value(str) fieldsScore_Correctionvariant to theScoreunion type withdata_type="CORRECTION"GetScoresResponseDataCorrectionfor API responses extendingCorrectionScorewith optionaltracefieldThe implementation follows the existing pattern used for Numeric, Categorical, and Boolean score types. All changes are auto-generated from the upstream API specification and maintain consistency with the codebase structure.
Confidence Score: 5/5
Important Files Changed
CorrectionScoreclass extendingBaseScorewith value and string_value fieldsScore_Correctionvariant to the Score union typeGetScoresResponseData_Correctionclass and included it in union typeGetScoresResponseDataCorrectionextendingCorrectionScorewith trace fieldSequence Diagram
sequenceDiagram participant Client participant API participant ScoreModule participant Database Client->>API: Request Score (Numeric/Categorical/Boolean/Correction) API->>ScoreModule: Parse Score Type alt Numeric Score ScoreModule->>Database: Store Score_Numeric Database-->>ScoreModule: Return Score else Categorical Score ScoreModule->>Database: Store Score_Categorical (value + string_value) Database-->>ScoreModule: Return Score else Boolean Score ScoreModule->>Database: Store Score_Boolean (value + string_value) Database-->>ScoreModule: Return Score else Correction Score ScoreModule->>Database: Store Score_Correction (value=0 + string_value) Database-->>ScoreModule: Return Score end ScoreModule-->>API: Return Typed Score API-->>Client: GetScoresResponseData (Union type)