Skip to content

Conversation

@langfuse-bot
Copy link
Collaborator

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

Important

Update API spec to change optional properties to nullable types and add expandMetadata parameter for metadata handling in ObservationsV2.

  • TypeScript Interfaces:
    • Changed optional properties to nullable types in BaseScore, BaseScoreV1, Comment, Dataset, DatasetItem, DatasetRun, DatasetRunItem, Model, Observation, ObservationsView, ScoreConfig, Session, Trace, TraceWithDetails, TraceWithFullDetails, and Usage.
    • Added comments for better documentation in the above interfaces.
  • ObservationsV2 Client:
    • Added expandMetadata query parameter in GetObservationsV2Request to allow non-truncated metadata retrieval in Client.ts.

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

Disclaimer: Experimental PR review

Greptile Summary

Auto-generated API spec synchronization from langfuse/langfuse commit 41f064c. This update brings TypeScript type definitions in sync with the backend API.

  • Type refinements: Converted many optional fields (field?: Type) to explicit nullable types (field: Type | null), making nullability explicit in the type system
  • New feature: Added expandMetadata parameter to the observationsV2 API, allowing retrieval of non-truncated metadata values (metadata is truncated to 200 chars by default)
  • Documentation: Added JSDoc comments across multiple interfaces for better API documentation
  • Type simplifications: Usage.unit changed from ModelUsageUnit enum to string | null; Observation.modelParameters changed from Record<string, MapValue> to unknown

These are standard Fern-generated updates that reflect changes in the backend API specification.

Confidence Score: 5/5

  • This PR is safe to merge - it's an auto-generated API spec update with no logic changes
  • All changes are auto-generated by Fern from the API definition. The type changes are intentional refinements to better reflect the backend API contract. No manual code changes, no logic modifications, and no new functionality beyond the expandMetadata parameter.
  • No files require special attention - all files are auto-generated type definitions

Important Files Changed

Filename Overview
packages/core/src/api/api/resources/commons/types/Observation.ts Significant type changes: multiple fields now required with explicit nullability; modelParameters changed to unknown; usage/usageDetails/costDetails now required
packages/core/src/api/api/resources/commons/types/Trace.ts Type refinements: multiple fields now required with explicit nullability; tags, public, and environment now required
packages/core/src/api/api/resources/commons/types/Usage.ts Breaking change: input, output, total now required; unit changed from ModelUsageUnit enum to string
packages/core/src/api/api/resources/observationsV2/client/Client.ts New feature: added expandMetadata query parameter support for non-truncated metadata retrieval
packages/core/src/api/api/resources/observationsV2/client/requests/GetObservationsV2Request.ts New feature: added expandMetadata optional parameter for retrieving non-truncated metadata values

Sequence Diagram

sequenceDiagram
    participant Client as SDK Client
    participant API as ObservationsV2 API
    participant Backend as Langfuse Backend

    Client->>API: getMany({ fields, expandMetadata, ... })
    Note over API: Build query params with<br/>new expandMetadata option
    API->>Backend: GET /api/public/v2/observations
    Backend-->>API: ObservationsV2Response
    Note over API: Response uses updated types:<br/>- Usage (required fields)<br/>- Observation (explicit nulls)<br/>- TraceWithDetails (optional arrays)
    API-->>Client: Typed response with<br/>explicit nullability
Loading

@vercel
Copy link

vercel bot commented Jan 7, 2026

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

Project Deployment Review Updated (UTC)
langfuse-js Ready Ready Preview Jan 7, 2026 0:40am

@Steffen911 Steffen911 requested a review from hassiebp January 7, 2026 14:07
@hassiebp hassiebp merged commit 1feeccf into main Jan 8, 2026
7 of 9 checks passed
@hassiebp hassiebp deleted the api-spec-bot-41f064c branch January 8, 2026 09:22
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