feat(api): update API spec from langfuse/langfuse a9621b2 #1485
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 updates API data types and models, introduces new types for score configurations and organizations, and suggests using v2 endpoints for improved performance.
ScoreConfigDataTypeinscore_config_data_type.pyfor score configuration.Organizationmodel inorganization.pyfor project association.ScoreDataTypeinscore_data_type.pyto includeCORRECTIONtype.metrics()inmetrics/client.pyto suggest using v2 endpoint for better performance.get_many()inobservations/client.pyto suggest using v2 endpoint for pagination and field selection.ScoreConfiginscore_config.pyto useScoreConfigDataType.Projectinproject.pyto includeOrganizationfield.OrganizationandScoreConfigDataTypeto__init__.pyfiles in relevant directories.reference.mdto guide users towards v2 endpoints for metrics and observations.This description was created by
for bc3505a. You can customize this summary. It will automatically update as commits are pushed.
Disclaimer: Experimental PR review
Greptile Summary
Auto-generated API client update from upstream langfuse/langfuse repository that introduces several type system improvements and new features.
Key Changes:
ScoreConfigDataTypeenum separate fromScoreDataTypeto properly distinguish between score configuration types (used when creating configs) and actual score data types (used when creating scores)CORRECTIONtype toScoreDataTypeenum for correction scores with updated visit patternOrganizationmodel and linked it toProjectmodel via neworganizationfieldScoreConfigDataTypeinstead ofScoreDataTypefor proper type separationAll changes are auto-generated via Fern from the API definition, ensuring consistency with the upstream API specification. The changes maintain backward compatibility while improving type safety and API clarity.
Confidence Score: 5/5
Important Files Changed
ScoreConfigDataTypefor score configurations (NUMERIC, BOOLEAN, CATEGORICAL) - auto-generated code, no issuesScoreDataTypeenum and updated visit method - auto-generated code, no issuesScoreDataTypetoScoreConfigDataType- correct separation of concernsScoreDataTypetoScoreConfigDataTypefor config creation - correct API separationOrganizationmodel with id and name fields - standard Pydantic model, no issuesorganizationfield toProjectmodel - properly typed with Organization modelSequence Diagram
sequenceDiagram participant Client as Client Code participant API as Langfuse API participant ScoreConfig as Score Config Types participant Project as Project Types Note over Client,Project: API Spec Update Changes Client->>API: Create Score Config API->>ScoreConfig: Use ScoreConfigDataType Note over ScoreConfig: New enum: NUMERIC, BOOLEAN, CATEGORICAL<br/>(separate from ScoreDataType) ScoreConfig-->>API: Config Created API-->>Client: Return ScoreConfig Client->>API: Create Score (with CORRECTION type) API->>ScoreConfig: Use ScoreDataType Note over ScoreConfig: ScoreDataType now includes<br/>CORRECTION type ScoreConfig-->>API: Score Created API-->>Client: Return Score Client->>API: Get Project Details API->>Project: Include Organization Note over Project: Project now includes<br/>organization field Project-->>API: Project with Organization API-->>Client: Return Project + Organization Note over Client,API: Deprecation Notices Client->>API: GET /metrics (v1) Note over API: Suggests using v2 endpoint API-->>Client: Metrics data Client->>API: GET /observations (v1) Note over API: Suggests using v2 endpoint API-->>Client: Observations data