Skip to content

Conversation

@langfuse-bot
Copy link
Collaborator

@langfuse-bot langfuse-bot commented Jan 30, 2026

Important

Add CorrectionScore type and integrate it into the API, updating relevant classes and unions.

  • New Features:
    • Add CorrectionScore class in correction_score.py.
    • Add Score_Correction class in score.py.
    • Add GetScoresResponseDataCorrection class in get_scores_response_data_correction.py.
  • Integrations:
    • Update Score union in score.py to include Score_Correction.
    • Update GetScoresResponseData union in get_scores_response_data.py to include GetScoresResponseData_Correction.
  • Imports and Exports:
    • Add CorrectionScore to imports and __all__ in __init__.py files in commons, score_v_2, and types directories.
    • Add GetScoresResponseDataCorrection to imports and __all__ in score_v_2 and types directories.

This description was created by Ellipsis 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.

  • Added CorrectionScore base class extending BaseScore with value (float) and string_value (str) fields
  • Added Score_Correction variant to the Score union type with data_type="CORRECTION"
  • Added GetScoresResponseDataCorrection for API responses extending CorrectionScore with optional trace field
  • Updated all import/export chains across modules to expose the new correction types

The 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

  • This PR is safe to merge with minimal risk
  • The changes are auto-generated from the API specification, follow established patterns for other score types, and consist only of additive changes with no breaking modifications
  • No files require special attention

Important Files Changed

Filename Overview
langfuse/api/resources/commons/types/correction_score.py New file defining CorrectionScore class extending BaseScore with value and string_value fields
langfuse/api/resources/commons/types/score.py Added Score_Correction variant to the Score union type
langfuse/api/resources/score_v_2/types/get_scores_response_data.py Added GetScoresResponseData_Correction class and included it in union type
langfuse/api/resources/score_v_2/types/get_scores_response_data_correction.py New file defining GetScoresResponseDataCorrection extending CorrectionScore with trace field

Sequence 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)
Loading

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

4 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants