feat(api): update API spec from langfuse/langfuse 71b8050#1555
Closed
langfuse-bot wants to merge 1 commit intomainfrom
Closed
feat(api): update API spec from langfuse/langfuse 71b8050#1555langfuse-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 auto-generated PR reorganizes the Langfuse Python SDK's API client structure by promoting newer v2 endpoints to first-class status and moving older v1 endpoints into a new
legacynamespace, reflecting the API spec update from langfuse/langfuse commit71b8050.Key structural changes:
legacynamespace (client.legacy.*): Consolidates older v1 endpoints —score_v1(create/delete scores),observations_v1(page-based observation listing), andmetrics_v1(v1 metrics) — underclient.legacy.*sub-clients.metricsclient promoted to v2:client.metrics.metrics()now hitsapi/public/v2/metricsand returnsMetricsV2Response; the old v1 metrics endpoint is accessible viaclient.legacy.metrics_v1.metrics().observationsclient promoted to v2:client.observations.get_many()now usesapi/public/v2/observationswith cursor-based pagination and field selection; the old page-based endpoint moves toclient.legacy.observations_v1.scoresmodule replacesscore_v2:client.scorestakes over from the removedscore_v2client for score listing operations.CreateScoreRequest,CreateScoreResponse,MetricsResponse,Observations,ObservationsViewsare removed from the top-level__all__and are now only accessible vialangfuse.api.legacy.*.legacyandscoresproperties, which violates the project's import placement rule (imports should be at the top of the module, not inside functions/methods).Confidence Score: 4/5
langfuse/api/client.pyandlangfuse/api/legacy/client.pyproperties, but this is a pervasive pattern throughout the pre-existing file and is a style concern rather than a runtime bug.langfuse/api/client.pyandlangfuse/api/legacy/client.pycontain the inline import violations;langfuse/api/__init__.pyis the most impactful file for downstream consumers due to the breaking removals from__all__.Important Files Changed
Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD A[LangfuseAPI / AsyncLangfuseAPI] --> B[client.metrics] A --> C[client.observations] A --> D[client.scores] A --> E[client.legacy] A --> F[client.score_configs] B -->|api/public/v2/metrics| B1[MetricsV2Response] C -->|api/public/v2/observations\ncursor-based pagination| C1[ObservationsV2Response] D -->|GET /api/public/scores| D1[GetScoresResponse] E --> G[legacy.metrics_v1] E --> H[legacy.observations_v1] E --> I[legacy.score_v1] G -->|api/public/metrics\nv1 endpoint| G1[MetricsResponse] H -->|api/public/observations\npage-based pagination| H1[ObservationsViews] H -->|api/public/observations/:id| H2[ObservationsView] I -->|POST /api/public/scores| I1[CreateScoreResponse] I -->|DELETE /api/public/scores/:id| I2[void]Last reviewed commit: eb4acfc
Context used:
dashboard- Move imports to the top of the module instead of placing them within functions or methods. (source)