Skip to content

feat(api): update API spec from langfuse/langfuse 53433e8#1712

Merged
wochinge merged 2 commits into
mainfrom
api-spec-bot-53433e8
Jun 16, 2026
Merged

feat(api): update API spec from langfuse/langfuse 53433e8#1712
wochinge merged 2 commits into
mainfrom
api-spec-bot-53433e8

Conversation

@langfuse-bot

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

Copy link
Copy Markdown
Collaborator

Greptile Summary

This is a Fern-generated API spec update that adds a delete endpoint for evaluators in the unstable API surface, following the same code pattern used by the existing list, create, and get endpoints.

  • Introduces DeleteEvaluatorResponse (a frozen Pydantic model with a single message field) and exports it through all relevant __init__.py layers.
  • Adds synchronous and asynchronous delete methods to both the raw and high-level evaluator clients, with proper error handling for 403 (managed evaluators), 409 (active evaluation rules), 404, and other standard HTTP error codes.

Confidence Score: 4/5

Auto-generated code that closely mirrors existing patterns; the only notable issue is pre-existing unreachable duplicate error handlers that appear in every method and are a Fern template artifact.

All six changed files follow established patterns. The one concern — duplicate status-code handlers where the second block (commons-namespace errors for 400/401/403/404/405) is never reached — is a pre-existing code-generator artifact shared by every other method in the file, not a regression introduced here.

langfuse/api/unstable/evaluators/raw_client.py — the new delete methods carry the same unreachable handler blocks as the pre-existing methods; the upstream Fern template should be fixed to deduplicate them.

Sequence Diagram

sequenceDiagram
    participant Caller
    participant EvaluatorsClient
    participant RawEvaluatorsClient
    participant LangfuseAPI

    Caller->>EvaluatorsClient: delete(evaluator_id)
    EvaluatorsClient->>RawEvaluatorsClient: delete(evaluator_id)
    RawEvaluatorsClient->>LangfuseAPI: "DELETE /api/public/unstable/evaluators/{evaluator_id}"
    alt 200-299 Success
        LangfuseAPI-->>RawEvaluatorsClient: "{message: Evaluator successfully deleted}"
        RawEvaluatorsClient-->>EvaluatorsClient: HttpResponse[DeleteEvaluatorResponse]
        EvaluatorsClient-->>Caller: DeleteEvaluatorResponse
    else "403 Forbidden (scope=managed)"
        LangfuseAPI-->>RawEvaluatorsClient: PublicApiError
        RawEvaluatorsClient-->>Caller: AccessDeniedError
    else 409 Conflict (evaluation rules still reference it)
        LangfuseAPI-->>RawEvaluatorsClient: PublicApiError
        RawEvaluatorsClient-->>Caller: ConflictError
    else 404 Not Found
        LangfuseAPI-->>RawEvaluatorsClient: PublicApiError
        RawEvaluatorsClient-->>Caller: NotFoundError
    else 400/401/429/500
        LangfuseAPI-->>RawEvaluatorsClient: PublicApiError
        RawEvaluatorsClient-->>Caller: Appropriate HTTP error
    end
Loading
Prompt To Fix All With AI
Fix the following 1 code review issue. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 1
langfuse/api/unstable/evaluators/raw_client.py:759-845
**Unreachable duplicate status-code handlers**

The second group of `if _response.status_code == ...` checks (for 400, 401, 403, 405, and 404, raising `commons`-namespace error types) is dead code. Because each of those codes is already handled earlier in the same `try` block by the `unstable`-namespace handlers, Python will always raise before reaching the second group. A caller expecting `commons_errors_not_found_error_NotFoundError` for a 404, for example, will instead receive `unstable_errors_errors_not_found_error_NotFoundError`. The same pattern is present in the existing `get` method and appears to be a Fern code-generator artifact, but it is worth tracking upstream so the template is fixed before the duplicates cause confusion.

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

Greptile also left 1 inline comment on this PR.

@langfuse-bot langfuse-bot requested a review from wochinge June 15, 2026 20:25
@github-actions

Copy link
Copy Markdown

@claude review

@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 — auto-generated Fern API spec update adding evaluator delete endpoint, mirroring existing patterns.

Extended reasoning...

Overview

This PR is an auto-generated update of the Fern-produced API client, syncing with langfuse/langfuse commit 53433e8. It adds a new delete method for evaluators on the unstable API surface (DELETE /api/public/unstable/evaluators/{evaluatorId}), along with the corresponding DeleteEvaluatorResponse type and lazy-import registrations across __init__.py files. All six files are explicitly auto-generated ("This file was auto-generated by Fern from our API Definition.").

Security risks

None. The change is confined to generated client code under langfuse/api/unstable/. URL construction uses jsonable_encoder(evaluator_id) consistent with the sibling get endpoint, and authentication / request handling is delegated to the shared httpx_client wrapper. No auth, crypto, or permission logic is touched.

Level of scrutiny

Low. This is a mechanical, generator-output PR with a tightly scoped surface (one new endpoint + one new response type). The new delete methods on RawEvaluatorsClient / AsyncRawEvaluatorsClient / EvaluatorsClient / AsyncEvaluatorsClient are structurally identical to the existing get methods, with the appropriate addition of a 409 ConflictError branch reflecting the documented "rules still reference this evaluator" case. Lazy-import dictionaries and __all__ lists are updated consistently across all four __init__.py files.

Other factors

No bugs were flagged by the bug hunting system. There are no prior reviewer comments to address. The duplicated error-handler blocks (e.g., two if _response.status_code == 400 branches per method) are a Fern code-generation artifact present throughout the existing client and not introduced by this PR.

Comment thread langfuse/api/unstable/evaluators/raw_client.py
@wochinge wochinge enabled auto-merge (squash) June 16, 2026 07:29
@wochinge wochinge merged commit ffd28a4 into main Jun 16, 2026
19 checks passed
@wochinge wochinge deleted the api-spec-bot-53433e8 branch June 16, 2026 07:33

@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.

Auto-generated Fern API spec update adding a delete evaluator endpoint.

Extended reasoning...

Overview

This PR is an auto-generated Fern API spec update that adds a delete endpoint for evaluators in the unstable API surface. It introduces a DeleteEvaluatorResponse Pydantic model and adds synchronous and asynchronous delete methods to both the raw and high-level evaluator clients, mirroring the existing list, create, and get patterns. All exports are wired through the relevant __init__.py layers.

Security risks

None. This is generated client SDK code that issues an HTTP DELETE request to a Langfuse API endpoint. No auth, crypto, or permissions logic; no user-supplied input flows into anything other than a URL path component (already passed through jsonable_encoder).

Level of scrutiny

Low. The diff is entirely Fern-generated and strictly follows the conventions established by the surrounding methods in the same file. The one concern flagged by Greptile (duplicate unreachable status-code handler blocks for 400/401/403/404/405) is a pre-existing code-generator artifact present in every other method in this file — not a regression introduced by this PR.

Other factors

The new model is a simple frozen Pydantic model with a single message field. Documentation is generated from the spec and accurately describes the 403 (managed evaluators) and 409 (active evaluation rules) error semantics. Tests are not added but this is mechanical generated code that mirrors well-tested patterns.

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.

2 participants