feat(api): update API spec from langfuse/langfuse 3a0eb19#1554
Closed
langfuse-bot wants to merge 1 commit intomainfrom
Closed
feat(api): update API spec from langfuse/langfuse 3a0eb19#1554langfuse-bot wants to merge 1 commit intomainfrom
langfuse-bot wants to merge 1 commit intomainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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 newclient.legacynamespace, while the V2 endpoints become the default forclient.scores,client.observations, andclient.metrics.Key changes:
legacynamespace (langfuse/api/legacy/) wraps the deprecated V1 endpoints for scores (score_v1), observations (observations_v1), and metrics (metrics_v1) with appropriate deprecation notices.score→legacy/score_v1,score_v2→scores,observations_v2→legacy/observations_v1(the legacy page-based API),metrics_v2→legacy/metrics_v1. The existingobservationsmodule now points to the V2 cursor-based endpoint.CreateScoreRequest/Response→CreateScoreV1Request/Response,Observations→ObservationsV1,ObservationsViews→ObservationsV1Views,MetricsV2Response→MetricsV1Response.CreateScoreRequest,CreateScoreResponse,Observations,ObservationsViews, andMetricsV2Responseare removed from the top-levellangfuse.apinamespace; any user code that imported these directly will break.Confidence Score: 4/5
legacynamespace correctly wraps deprecated endpoints with clear deprecation notices. The main risk is the breaking removal ofCreateScoreRequest,CreateScoreResponse,Observations,ObservationsViews, andMetricsV2Responsefrom the publiclangfuse.apinamespace — downstream consumers importing these directly will receive anImportErrororAttributeErrorafter upgrading. This is a known and intentional breaking change to enforce migration to the V2 API.langfuse/api/__init__.pyandlangfuse/api/client.pyfor 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:#FFB6C1Last reviewed commit: 7162c6b