Skip to content

Conversation

@langfuse-bot
Copy link
Collaborator

@langfuse-bot langfuse-bot commented Feb 3, 2026

Important

This PR adds a CORRECTION score type and dataset versioning to the API, allowing correction feedback storage and temporal dataset queries.

  • Behavior:
    • Adds CORRECTION score type to Score and GetScoresResponseData unions, allowing correction feedback storage.
    • Introduces dataset versioning with version parameter in DatasetManager.get() and DatasetItems.list() for temporal queries.
  • Types:
    • Adds CorrectionScore interface in CorrectionScore.ts with value and stringValue properties.
    • Updates Score.ts and GetScoresResponseData.ts to include Correction variant.
  • Client:
    • Updates Client.ts in datasetItems and datasetRunItems to support version parameter.
    • Adds datasetVersion field in CreateDatasetRunItemRequest.ts for specifying dataset version in runs.
  • Tests:
    • Adds E2E test in datasets.e2e.test.ts to verify dataset versioning functionality.

This description was created by Ellipsis for 4d453cd. You can customize this summary. It will automatically update as commits are pushed.


Disclaimer: Experimental PR review

Greptile Overview

Greptile Summary

This PR updates the API specification from the main Langfuse repository, introducing two key features:

1. Correction Score Type: Adds a new CORRECTION data type to the scoring system, allowing users to store correction feedback alongside numeric, categorical, and boolean scores. The CorrectionScore interface includes both a numeric value (always 0) and a stringValue for the correction content.

2. Dataset Versioning: Introduces temporal query support for datasets via an optional version parameter (ISO 8601 timestamp). Users can now:

  • Retrieve dataset items as they existed at a specific point in time
  • Pin experiment runs to specific dataset versions for reproducibility

All changes follow the existing code patterns and maintain backward compatibility through optional parameters. The code is auto-generated via Fern from the API definition.

Confidence Score: 5/5

  • This PR is safe to merge with no issues detected
  • All changes are auto-generated from API definitions using Fern, follow consistent patterns across the codebase, maintain backward compatibility with optional parameters, and correctly implement TypeScript discriminated unions
  • No files require special attention

Important Files Changed

Filename Overview
packages/core/src/api/api/resources/commons/types/CorrectionScore.ts Added new CorrectionScore interface extending BaseScore with value and stringValue properties
packages/core/src/api/api/resources/commons/types/Score.ts Added Correction variant to Score discriminated union with dataType: "CORRECTION"
packages/core/src/api/api/resources/datasetItems/client/Client.ts Added version parameter to dataset items list endpoint for temporal queries
packages/core/src/api/api/resources/datasetRunItems/types/CreateDatasetRunItemRequest.ts Added optional datasetVersion field for specifying dataset version in experiment runs
packages/core/src/api/api/resources/scoreV2/types/GetScoresResponseData.ts Added Correction variant to GetScoresResponseData discriminated union

Sequence Diagram

sequenceDiagram
    participant Client
    participant DatasetItemsAPI
    participant DatasetRunItemsAPI
    participant ScoreV2API
    
    Note over Client,ScoreV2API: New Correction Score Support
    
    Client->>ScoreV2API: Request scores
    ScoreV2API-->>Client: Return scores (Numeric/Categorical/Boolean/Correction)
    
    Note over Client,DatasetItemsAPI: Dataset Versioning
    
    Client->>DatasetItemsAPI: Get dataset items (with version param)
    DatasetItemsAPI-->>Client: Return items at specified timestamp
    
    Client->>DatasetRunItemsAPI: Create dataset run item (with datasetVersion)
    DatasetRunItemsAPI-->>Client: Return run item with version snapshot
Loading

@vercel
Copy link

vercel bot commented Feb 3, 2026

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

Project Deployment Actions Updated (UTC)
langfuse-js Ready Ready Preview Feb 5, 2026 9:04pm

Request Review

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.

5 files reviewed, no comments

Edit Code Review Agent Settings | Greptile

@marliessophie marliessophie merged commit df27672 into main Feb 9, 2026
12 of 14 checks passed
@marliessophie marliessophie deleted the api-spec-bot-966662e branch February 9, 2026 09:36
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