Skip to content

feat(api): update API spec from langfuse/langfuse 41f5847#812

Merged
wochinge merged 1 commit into
mainfrom
api-spec-bot-41f5847
May 28, 2026
Merged

feat(api): update API spec from langfuse/langfuse 41f5847#812
wochinge merged 1 commit into
mainfrom
api-spec-bot-41f5847

Conversation

@langfuse-bot

@langfuse-bot langfuse-bot commented May 28, 2026

Copy link
Copy Markdown
Collaborator

Greptile Summary

This PR syncs the JavaScript SDK's generated API client against upstream Langfuse server commit 41f5847, introducing a new unstable namespace with Evaluators and EvaluationRules CRUD endpoints, a DELETE method for LlmConnections, new blob-storage export fields (exportSource, exportFieldGroups), and a CreateScoreSource field on the legacy score creation request.

  • New unstable namespace — adds fully typed clients for evaluators and evaluation rules, each backed by a rich set of new domain types (EvaluationRule, Evaluator, filter/mapping types, structured error classes).
  • ObservationV2 field additionsmodelId is promoted to required, and inputPrice, outputPrice, totalPrice are added as new required fields; traceName, tags, and release are added as optional denormalized trace fields.
  • BlobStorageIntegration updates — new optional exportSource and exportFieldGroups request/response fields, plus a new BlobStorageExportFieldGroup enum supporting trace_context.

Confidence Score: 3/5

Mergeable with caution — the new unstable endpoints have unreachable error-handling branches that could silently misdirect callers catching specific error types, and the ObservationV2 interface promotes previously optional fields to required.

All new unstable client methods share a generated switch block that places legacy LangfuseAPI.*Error throw statements under case labels already handled by the unstable.*Error block above them. Separately, ObservationV2.modelId and three new price fields were made required, which is a TypeScript breaking change.

packages/core/src/api/api/resources/unstable/resources/evaluators/client/Client.ts and evaluationRules/client/Client.ts — every method's error switch contains unreachable legacy error branches. packages/core/src/api/api/resources/commons/types/ObservationV2.ts — four fields changed from optional to required.

Prompt To Fix All With AI
Fix the following 3 code review issues. Work through them one at a time, proposing concise fixes.

---

### Issue 1 of 3
packages/core/src/api/api/resources/unstable/resources/evaluators/client/Client.ts:226-246
**Dead code: duplicate switch-case labels shadow legacy error types**

The switch block in `__create` first handles `case 400` (throwing `LangfuseAPI.unstable.BadRequestError`) and then re-declares `case 400`, `401`, `403`, and `405` to throw the legacy `LangfuseAPI.*Error` variants. In JavaScript a `switch` statement exits on the first matching case, so the legacy `LangfuseAPI.Error`, `LangfuseAPI.UnauthorizedError`, `LangfuseAPI.AccessDeniedError`, and `LangfuseAPI.MethodNotAllowedError` branches will **never be reached**. Any caller catching those specific error types for 400/401/403/405 responses from this endpoint will silently miss them. The same pattern repeats in `__list` and across every method in `EvaluationRules/client/Client.ts`.

### Issue 2 of 3
packages/core/src/api/api/resources/unstable/resources/evaluators/client/Client.ts:115-116
**Duplicate `dataType` key in JSDoc example**

The `@example` block for `create()` sets `dataType: "NUMERIC"` twice on consecutive lines inside the `outputDefinition` object literal. Duplicate object keys are valid JavaScript but the first value is silently overwritten by the second, making the example inconsistent with the intent. The extra key should be removed.

### Issue 3 of 3
packages/core/src/api/api/resources/commons/types/ObservationV2.ts:77-85
**Potentially breaking: `modelId`, `inputPrice`, `outputPrice`, `totalPrice` promoted to required fields**

`modelId` was previously `modelId?: string | null` (optional); it and three new sibling fields (`inputPrice`, `outputPrice`, `totalPrice`) are now required (`string | null`). Any existing code that constructs an `ObservationV2` object without supplying these fields will now fail TypeScript compilation. Because this is a generated API type file the impact depends on whether consumers type-check against it, but the interface change is technically breaking.

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

Greptile also left 2 inline comments on this PR.

@langfuse-bot
langfuse-bot requested a review from wochinge May 28, 2026 13:56
@vercel

vercel Bot commented May 28, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
langfuse-js Ready Ready Preview May 28, 2026 1:57pm

Request Review

@github-actions

Copy link
Copy Markdown

@claude review

Comment thread packages/core/src/api/api/resources/commons/types/ObservationV2.ts
@wochinge
wochinge merged commit e24124e into main May 28, 2026
15 checks passed
@wochinge
wochinge deleted the api-spec-bot-41f5847 branch May 28, 2026 15:07
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