feat(api): update API spec from langfuse/langfuse d59b6a3 #714
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 API spec to introduce
ScoreConfigDataType, addOrganizationinterface, and suggest using v2 endpoints in clients.ScoreConfigDataTypeinScoreConfigDataType.tswith values "NUMERIC", "BOOLEAN", "CATEGORICAL".ScoreConfig.tsandCreateScoreConfigRequest.tsto useScoreConfigDataTypeinstead ofScoreDataType.ScoreDataTypeinScoreDataType.ts.Organizationinterface inOrganization.ts.Projectinterface inProject.tsto includeorganizationfield.fieldsparameter toGetScoresRequestinGetScoresRequest.ts.MetricsandObservationsclients to suggest using v2 endpoints for better performance and features.ScoreConfigDataTypeexport inindex.tsof commons types.This description was created by
for 42706db. You can customize this summary. It will automatically update as commits are pushed.
Disclaimer: Experimental PR review
Greptile Summary
This PR updates the auto-generated TypeScript API client to match the latest Langfuse API specification. The changes include type system improvements, new API features, and documentation enhancements.
Key Changes:
ScoreConfigDataTypefromScoreDataTypeto properly distinguish between score configuration types (NUMERIC, BOOLEAN, CATEGORICAL) and actual score data types (which now includes CORRECTION)Organizationtype and integrated it into theProjectinterface to expose organizational structurefieldsparameter to the scores v2 endpoint for selective field inclusion, improving query performanceScoreBodyAll changes are auto-generated from the API specification and maintain consistency with existing patterns.
Confidence Score: 5/5
Important Files Changed
Sequence Diagram
sequenceDiagram participant Client as SDK Client participant API as Langfuse API participant DB as Database Note over Client,DB: Score Configuration Flow Client->>API: POST /scoreConfigs (CreateScoreConfigRequest) Note right of Client: Uses ScoreConfigDataType<br/>(NUMERIC, BOOLEAN, CATEGORICAL) API->>DB: Store ScoreConfig DB-->>API: ScoreConfig with ScoreConfigDataType API-->>Client: ScoreConfig response Note over Client,DB: Score Creation Flow Client->>API: POST /ingestion/score (ScoreBody) Note right of Client: Uses ScoreDataType<br/>(NUMERIC, BOOLEAN, CATEGORICAL, CORRECTION) API->>DB: Validate against ScoreConfig API->>DB: Store Score DB-->>API: Score created API-->>Client: Score response Note over Client,DB: Enhanced Query Flow Client->>API: GET /v2/scores?fields=score,trace Note right of Client: New fields parameter<br/>for selective field inclusion API->>DB: Query scores with field selection DB-->>API: Filtered score data API-->>Client: Optimized response Note over Client,DB: Project & Organization Client->>API: GET /projects API->>DB: Fetch projects with organizations DB-->>API: Project + Organization data API-->>Client: Project with organization field