feat(api): update API spec from langfuse/langfuse db01ff9 #1435
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
Update
valuefield to non-optional float with default 0 in score-related classes across multiple files.valuefield fromOptional[float]tofloatinCategoricalScore,CategoricalScoreV1,Score_Categorical,ScoreV1_Categorical, andGetScoresResponseData_Categorical.valuedefaults to 0 if no config is linked.categorical_score.py,categorical_score_v_1.py,score.py,score_v_1.py,get_scores_response_data.py.This description was created by
for 51ca4c5. You can customize this summary. It will automatically update as commits are pushed.
Disclaimer: Experimental PR review
Greptile Overview
Greptile Summary
Updated API type definitions for categorical scores to make the
valuefield required instead of optional across all score-related models.value: Optional[float]tovalue: floatinCategoricalScore,CategoricalScoreV1, and all categorical score variant classesThe changes are consistent across all affected type definitions and properly synchronized with the upstream API specification from langfuse/langfuse.
Confidence Score: 5/5
Important Files Changed
File Analysis
valuefromOptional[float]to requiredfloatfield with updated documentationvaluefromOptional[float]to requiredfloatfield with updated documentationvaluefromOptional[float]to requiredfloatinScore_CategoricalclassvaluefromOptional[float]to requiredfloatinScoreV1_CategoricalclassvaluefromOptional[float]to requiredfloatinGetScoresResponseData_CategoricalclassSequence Diagram
sequenceDiagram participant API as Langfuse API participant Client as Python SDK participant App as Application Code Note over API,Client: API Spec Update (db01ff9) API->>Client: Updated API Spec Note over Client: Auto-generated code changes Client->>Client: Update CategoricalScore classes Note over Client: value: Optional[float] → value: float App->>Client: Fetch categorical score Client->>API: GET score data API-->>Client: JSON response with value field Note over API: Backend now always<br/>returns value (0 if no config) Client->>Client: Deserialize to CategoricalScore Note over Client: Pydantic validation<br/>requires value field Client-->>App: CategoricalScore object