Skip to content

feat(api): update API spec from langfuse/langfuse cf53f2e#1704

Closed
langfuse-bot wants to merge 1 commit into
mainfrom
api-spec-bot-cf53f2e
Closed

feat(api): update API spec from langfuse/langfuse cf53f2e#1704
langfuse-bot wants to merge 1 commit into
mainfrom
api-spec-bot-cf53f2e

Conversation

@langfuse-bot

@langfuse-bot langfuse-bot commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

Greptile Summary

This is an auto-generated PR syncing the Python SDK's docstrings and type stubs with the upstream Langfuse API spec (commit cf53f2e). No runtime logic changes: only docstrings, enum descriptions, and parameter annotations are updated.

  • scores v1 deprecated: GET /api/public/scores list and single-score endpoints are marked deprecated in their docstrings, directing callers to GET /api/public/v3/scores; the endpoints no longer exist on Langfuse v4+.
  • scores v3 field-group spec tightened: core is removed from the fields parameter's allowed-values list (it is now always returned); only details, subject, and annotation are accepted. Any existing caller that explicitly passes core will receive HTTP 400 on Langfuse v4.
  • blob-storage export field groups broadened: exportFieldGroups now applies to LEGACY_TRACES_OBSERVATIONS as well (groups without a counterpart in the legacy model are silently omitted); the previous HTTP 400 rejection for that source has been removed from the spec. Dataset item id documentation adds a 255-character limit.

Confidence Score: 3/5

The spec change removing core from the allowed fields values for scores v3 will cause HTTP 400 responses for any caller that explicitly passes it, but all other changes are documentation-only expansions.

Callers that previously relied on fields=core as documented will get 400 errors when talking to a Langfuse v4 server after this SDK update ships. All other changes — blob-storage field-group broadening, dataset item length note, and scores v1 deprecation notices — are safe documentation updates with no SDK-level behavior changes.

langfuse/api/scores_v3/client.py and langfuse/api/scores_v3/raw_client.py — the fields parameter description now lists only details, subject, annotation as allowed; core is silently dropped from the spec and the HTTP 400 rule is still in place.

Sequence Diagram

sequenceDiagram
    participant Client as SDK Client
    participant API as Langfuse API (v4)

    Note over Client,API: scores v1 (deprecated – unavailable on v4)
    Client->>API: GET /api/public/scores
    API-->>Client: HTTP 404 / not available on v4

    Note over Client,API: scores v3 – core always returned
    Client->>API: "GET /api/public/v3/scores?fields=details,subject"
    API-->>Client: "{id, projectId, name, value, ... (core always), comment, configId, subject}"

    Note over Client,API: scores v3 – passing core now rejected
    Client->>API: "GET /api/public/v3/scores?fields=core"
    API-->>Client: HTTP 400 (unknown group name)

    Note over Client,API: blob storage – LEGACY_TRACES_OBSERVATIONS now accepts exportFieldGroups
    Client->>API: PUT /api/public/blob-storage-integrations
    API-->>Client: 200 OK (groups without legacy counterpart silently omitted)
Loading
Prompt To Fix All With AI
Fix the following 2 code review issues. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 2
langfuse/api/scores_v3/client.py:80-81
**Removing `core` from allowed `fields` values is a breaking change**

The previous spec listed `core` as an explicitly allowed value: `"Allowed: core, details, subject, annotation. Defaults to 'core'."` — so users who built integrations passing `fields="core"` or `fields="core,details"` explicitly relied on this. The new spec removes `core` from the allowed list and keeps the rule `"Unknown group names return HTTP 400"`. Any caller on Langfuse v4 that currently passes `core` in the `fields` string will receive a 400 error after upgrading. The same change is mirrored in `raw_client.py` and both async variants.

### Issue 2 of 2
langfuse/api/scores/client.py:57-59
**No Python-level deprecation warning emitted at call time**

The deprecation is documented in the docstring only. Users consuming this SDK without reading generated docs won't be alerted. Adding a `warnings.warn("...", DeprecationWarning, stacklevel=2)` call at the top of `get_many` and `get` (both sync and async variants, and the same in `raw_client.py`) would surface the message at runtime.

Reviews (1): Last reviewed commit: "feat(api): update API spec from langfuse..." | Re-trigger Greptile

Greptile also left 1 inline comment on this PR.

@github-actions

Copy link
Copy Markdown

@claude review

Comment on lines 80 to +81
fields : typing.Optional[str]
Comma-separated field groups to include. Allowed: core, details, subject, annotation. Defaults to "core". Unknown names return HTTP 400.
Comma-separated field groups to include in addition to the always-returned core fields. Allowed: details, subject, annotation — see the endpoint description for the fields each group adds. Unknown names return HTTP 400.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Removing core from allowed fields values is a breaking change

The previous spec listed core as an explicitly allowed value: "Allowed: core, details, subject, annotation. Defaults to 'core'." — so users who built integrations passing fields="core" or fields="core,details" explicitly relied on this. The new spec removes core from the allowed list and keeps the rule "Unknown group names return HTTP 400". Any caller on Langfuse v4 that currently passes core in the fields string will receive a 400 error after upgrading. The same change is mirrored in raw_client.py and both async variants.

Prompt To Fix With AI
This is a comment left during a code review.
Path: langfuse/api/scores_v3/client.py
Line: 80-81

Comment:
**Removing `core` from allowed `fields` values is a breaking change**

The previous spec listed `core` as an explicitly allowed value: `"Allowed: core, details, subject, annotation. Defaults to 'core'."` — so users who built integrations passing `fields="core"` or `fields="core,details"` explicitly relied on this. The new spec removes `core` from the allowed list and keeps the rule `"Unknown group names return HTTP 400"`. Any caller on Langfuse v4 that currently passes `core` in the `fields` string will receive a 400 error after upgrading. The same change is mirrored in `raw_client.py` and both async variants.

How can I resolve this? If you propose a fix, please make it concise.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM — docstring-only changes from the API spec sync.

Extended reasoning...

Overview

Auto-generated PR syncing the Python client from Fern API spec cf53f2e. All 13 changed files are under langfuse/api/ (the auto-generated client). The diff is exclusively docstring updates inside auto-generated code: clarifying that exportFieldGroups now applies to all blob storage export sources (not just OBSERVATIONS_V2), adding a 255-char limit note to dataset item id, adding deprecation notices to the v2 /scores endpoints, and expanding the scores_v3 fields parameter description.

Security risks

None. No code paths, signatures, request bodies, or auth handling changed — purely textual updates to docstrings and enum class docstrings. Generated client behavior is byte-identical.

Level of scrutiny

Very low. This is the standard automated Fern regeneration that lands routinely on this repo, and the diff is verifiably docstring-only. No human design judgement is needed.

Other factors

Bug hunting agents reported no findings. Files are auto-generated and marked as such (# This file was auto-generated by Fern from our API Definition.), so direct editing is discouraged anyway — the source of truth is upstream.

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