Skip to content

feat(api): update API spec from langfuse/langfuse 3a0eb19#1554

Closed
langfuse-bot wants to merge 1 commit intomainfrom
api-spec-bot-3a0eb19
Closed

feat(api): update API spec from langfuse/langfuse 3a0eb19#1554
langfuse-bot wants to merge 1 commit intomainfrom
api-spec-bot-3a0eb19

Conversation

@langfuse-bot
Copy link
Copy Markdown
Collaborator

@langfuse-bot langfuse-bot commented Mar 6, 2026

Disclaimer: Experimental PR review

Greptile Summary

This PR updates the auto-generated Fern API bindings to reflect a new API versioning strategy: legacy V1 endpoints (score, observations, metrics) are consolidated under a new client.legacy namespace, while the V2 endpoints become the default for client.scores, client.observations, and client.metrics.

Key changes:

  • New legacy namespace (langfuse/api/legacy/) wraps the deprecated V1 endpoints for scores (score_v1), observations (observations_v1), and metrics (metrics_v1) with appropriate deprecation notices.
  • Module renames: scorelegacy/score_v1, score_v2scores, observations_v2legacy/observations_v1 (the legacy page-based API), metrics_v2legacy/metrics_v1. The existing observations module now points to the V2 cursor-based endpoint.
  • Type renames in the legacy namespace: CreateScoreRequest/ResponseCreateScoreV1Request/Response, ObservationsObservationsV1, ObservationsViewsObservationsV1Views, MetricsV2ResponseMetricsV1Response.
  • Breaking public API changes: CreateScoreRequest, CreateScoreResponse, Observations, ObservationsViews, and MetricsV2Response are removed from the top-level langfuse.api namespace; any user code that imported these directly will break.

Confidence Score: 4/5

  • Safe to merge — changes are auto-generated, additive, and follow established patterns. The primary risk is the breaking removal of legacy type exports from the top-level namespace.
  • All files are auto-generated by Fern from the API spec, logic changes are minimal and match the stated restructuring intent, and the new legacy namespace correctly wraps deprecated endpoints with clear deprecation notices. The main risk is the breaking removal of CreateScoreRequest, CreateScoreResponse, Observations, ObservationsViews, and MetricsV2Response from the public langfuse.api namespace — downstream consumers importing these directly will receive an ImportError or AttributeError after upgrading. This is a known and intentional breaking change to enforce migration to the V2 API.
  • langfuse/api/__init__.py and langfuse/api/client.py for the removed public exports, as these constitute the breaking surface area for consumers of the SDK.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[LangfuseAPI / AsyncLangfuseAPI] --> B[client.scores\n new default - V2\n GET /api/public/v2/scores]
    A --> C[client.observations\n new default - V2\n GET /api/public/v2/observations\n cursor-based pagination]
    A --> D[client.metrics\n new default - V2\n GET /api/public/v2/metrics]
    A --> E[client.legacy\n new namespace]

    E --> F[legacy.score_v1\n deprecated V1\n POST/DELETE /api/public/scores]
    E --> G[legacy.observations_v1\n deprecated V1\n GET /api/public/observations\n page-based pagination]
    E --> H[legacy.metrics_v1\n deprecated V1\n GET /api/public/metrics]

    style B fill:#90EE90
    style C fill:#90EE90
    style D fill:#90EE90
    style E fill:#FFD700
    style F fill:#FFB6C1
    style G fill:#FFB6C1
    style H fill:#FFB6C1
Loading

Last reviewed commit: 7162c6b

@langfuse-bot langfuse-bot requested a review from hassiebp March 6, 2026 10:45
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.

1 participant