feat(api): update API spec from langfuse/langfuse d32b852#1692
feat(api): update API spec from langfuse/langfuse d32b852#1692langfuse-bot wants to merge 1 commit into
Conversation
|
@claude review |
There was a problem hiding this comment.
LGTM, mechanical auto-generated API spec update adding the scores_v3 module.
Extended reasoning...
Overview
This PR is an auto-generated update from the Fern API spec (langfuse/langfuse d32b852). It adds a new scores_v3 API module that exposes GET /api/public/v3/scores and the corresponding polymorphic score types (Numeric/Boolean/Categorical/Text/Correction) along with a discriminated ScoreSubjectV3 union (trace/observation/session/experiment). The only edits to existing files are additive: new entries in langfuse/api/__init__.py (_dynamic_imports, __all__, TYPE_CHECKING block) and a new lazy-loaded scores_v3 property on both LangfuseAPI and AsyncLangfuseAPI in langfuse/api/client.py.
Security risks
None identified. This is purely an additive type/client surface; no auth, crypto, serialization, or transport code is changed. The new client reuses the existing SyncClientWrapper/AsyncClientWrapper and error types from commons.
Level of scrutiny
Low. Every file carries the # This file was auto-generated by Fern from our API Definition header and mirrors the structure of sibling modules (e.g., scores, scores_v1). The patterns for lazy imports, raw clients, and discriminated unions match conventions already established and reviewed in this codebase. The bug hunting system found no issues.
Other factors
The PR is opened by automation in response to an upstream API spec change, and the trigger comment @claude review is the only timeline activity. No outstanding reviewer comments. Approving without a human in the loop is appropriate for this class of codegen-only update.
Greptile Summary
This PR adds a new
scores_v3module implementing theGET /api/public/v3/scoresendpoint (requires Langfuse v4+), which returns a polymorphicvaluefield typed via a discriminated union ondataType.ScoresV3Client/AsyncScoresV3Clientare wired into the top-levelLangfuseAPI/AsyncLangfuseAPIclients as a lazy-initializedscores_v3property, following the same pattern as existing sub-clients.ScoreV3,ScoreSubjectV3,BaseScoreV3, and concrete subtypes) model the five score data types (NUMERIC, BOOLEAN, CATEGORICAL, TEXT, CORRECTION) and four subject kinds (trace, observation, session, experiment) using discriminated unions.Confidence Score: 4/5
Safe to merge; the new scores_v3 module is additive and isolated, with no changes to existing endpoints.
All 20 changed files are either new auto-generated modules or additive registrations in init.py and client.py. The Pydantic models, discriminated unions, and HTTP error handling follow established codebase patterns correctly. The only non-spec item is a style-rule violation where runtime imports are placed inside property methods rather than at module level.
langfuse/api/client.py — the two scores_v3 property methods both contain inline imports that deviate from the team's import-placement rule.
Class Diagram
%%{init: {'theme': 'neutral'}}%% classDiagram class LangfuseAPI { +scores_v3 ScoresV3Client } class AsyncLangfuseAPI { +scores_v3 AsyncScoresV3Client } class ScoresV3Client { +get_many_v3() GetScoresV3Response } class AsyncScoresV3Client { +get_many_v3() GetScoresV3Response } class RawScoresV3Client { +get_many_v3() HttpResponse[GetScoresV3Response] } class GetScoresV3Response { +data List[ScoreV3] +meta GetScoresV3Meta } class ScoreV3 { <<Union discriminator=data_type>> } class BaseScoreV3 { +id str +project_id str +subject Optional[ScoreSubjectV3] } class ScoreSubjectV3 { <<Union discriminator=kind>> } LangfuseAPI --> ScoresV3Client AsyncLangfuseAPI --> AsyncScoresV3Client ScoresV3Client --> RawScoresV3Client ScoresV3Client ..> GetScoresV3Response GetScoresV3Response --> ScoreV3 ScoreV3 --> BaseScoreV3 BaseScoreV3 --> ScoreSubjectV3Prompt To Fix All With AI
Reviews (1): Last reviewed commit: "feat(api): update API spec from langfuse..." | Re-trigger Greptile
Context used:
Learned From
langfuse/langfuse-python#1387