Skip to content

Conversation

@langfuse-bot
Copy link
Collaborator

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

Important

Update API spec to introduce ScoreConfigDataType, add Organization interface, and suggest using v2 endpoints in clients.

  • Types:
    • Introduce ScoreConfigDataType in ScoreConfigDataType.ts with values "NUMERIC", "BOOLEAN", "CATEGORICAL".
    • Update ScoreConfig.ts and CreateScoreConfigRequest.ts to use ScoreConfigDataType instead of ScoreDataType.
    • Add "CORRECTION" to ScoreDataType in ScoreDataType.ts.
  • Interfaces:
    • Add Organization interface in Organization.ts.
    • Update Project interface in Project.ts to include organization field.
    • Add fields parameter to GetScoresRequest in GetScoresRequest.ts.
  • Clients:
    • Add comments in Metrics and Observations clients to suggest using v2 endpoints for better performance and features.
  • Misc:
    • Add ScoreConfigDataType export in index.ts of commons types.

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

  • Separated ScoreConfigDataType from ScoreDataType to properly distinguish between score configuration types (NUMERIC, BOOLEAN, CATEGORICAL) and actual score data types (which now includes CORRECTION)
  • Added Organization type and integrated it into the Project interface to expose organizational structure
  • Added fields parameter to the scores v2 endpoint for selective field inclusion, improving query performance
  • Enhanced documentation with recommendations to use v2 endpoints for metrics and observations
  • Added clarifying documentation for correction scores in ScoreBody

All changes are auto-generated from the API specification and maintain consistency with existing patterns.

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • All changes are auto-generated from the API specification using Fern, ensuring consistency and correctness. The type system refactoring properly separates concerns between ScoreConfigDataType and ScoreDataType, the new Organization type is well-integrated, and all changes follow existing patterns. No logical issues, security concerns, or breaking changes detected.
  • No files require special attention

Important Files Changed

Filename Overview
packages/core/src/api/api/resources/commons/types/ScoreConfigDataType.ts New type added for score configuration data types (NUMERIC, BOOLEAN, CATEGORICAL)
packages/core/src/api/api/resources/commons/types/ScoreDataType.ts Added CORRECTION data type to existing score data types
packages/core/src/api/api/resources/commons/types/ScoreConfig.ts Changed dataType from ScoreDataType to ScoreConfigDataType for proper type separation
packages/core/src/api/api/resources/scoreConfigs/types/CreateScoreConfigRequest.ts Updated dataType to use ScoreConfigDataType instead of ScoreDataType
packages/core/src/api/api/resources/projects/types/Project.ts Added organization field to Project interface
packages/core/src/api/api/resources/scoreV2/client/Client.ts Added fields parameter support for field selection in scores query

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
Loading

@vercel
Copy link

vercel bot commented Jan 1, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
langfuse-js Ready Ready Preview Jan 1, 2026 4:47pm

@hassiebp hassiebp merged commit 28ab6b6 into main Jan 3, 2026
8 checks passed
@hassiebp hassiebp deleted the api-spec-bot-d59b6a3 branch January 3, 2026 06:55
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.

3 participants