Skip to content

feat(api): update API spec from langfuse/langfuse 1ea859c - #929

Merged
wochinge merged 1 commit into
mainfrom
api-spec-bot-1ea859c-33494604967-1
Sep 1, 2026
Merged

feat(api): update API spec from langfuse/langfuse 1ea859c#929
wochinge merged 1 commit into
mainfrom
api-spec-bot-1ea859c-33494604967-1

Conversation

@langfuse-bot

@langfuse-bot langfuse-bot commented Sep 1, 2026

Copy link
Copy Markdown
Collaborator

Greptile Summary

This generated API update expands LLM-as-judge prompts from one user message to ordered system, user, and assistant messages.

  • Adds and publicly exports the evaluator chat-message role type and constants.
  • Widens evaluator create, update, and response prompt contracts to support multiple chat messages.
  • Leaves the documented system-message ordering restriction unrepresented in the public TypeScript type.

Confidence Score: 4/5

The prompt ordering contract should be represented or validated before merging so type-safe callers cannot submit a system message in an invalid position.

The new role union is correctly exported, but combining it with an unrestricted message array accepts prompts that violate the newly documented ordering rule and can fail only after reaching the API.

Files Needing Attention: packages/core/src/api/api/resources/evaluators/types/EvaluatorChatPrompt.ts

Prompt To Fix All With AI
### Issue 1
packages/core/src/api/api/resources/evaluators/types/EvaluatorChatPrompt.ts:9
**Prompt ordering remains unrestricted**

When a caller places a system-role message after another message, `EvaluatorChatMessage[]` accepts and serializes a prompt that violates the documented ordering contract, causing the create or update request to fail server validation.

---

For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.

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

Greptile also left 1 inline comment on this PR.

@vercel

vercel Bot commented Sep 1, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated
langfuse-js Ready Ready Preview Sep 1, 2026 9:57am UTC

Request Review

@github-actions

github-actions Bot commented Sep 1, 2026

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, straightforward auto-generated type update.

What was reviewed: the new EvaluatorChatMessageRole union type and its re-export from the types index; the widening of EvaluatorChatMessage.role from the "user" literal to that union; and the doc-comment updates on the chat prompt/request/response types describing support for multi-role, ordered chat messages. No runtime logic changed, and the edits are consistent with the auto-generated Fern pattern used elsewhere in this file set.

Extended reasoning...

Overview

This PR is a Fern-auto-generated sync of the Langfuse evaluators SDK types with an updated API definition. It adds a new EvaluatorChatMessageRole string-literal union ("system" | "user" | "assistant"), widens EvaluatorChatMessage.role from the literal "user" to this new union type, re-exports the new type from the types index.ts, and updates several doc comments (CreateLlmAsJudgeEvaluatorRequest, UpdateLlmAsJudgeEvaluatorRequest, LlmAsJudgeEvaluator, LlmAsJudgeEvaluatorVersion, EvaluatorChatPrompt, EvaluatorChatPromptInput) to describe support for an ordered list of chat messages rather than exactly one user message.

Security risks

None. These are pure TypeScript type/interface definitions and JSDoc comments with no executable logic, no I/O, no auth/crypto/permission handling, and no changes to request validation or serialization behavior.

Level of scrutiny

Low. The change is confined to auto-generated type declarations mirroring an upstream OpenAPI/Fern spec change, is small in scope (9 files, mostly comment and type-widening edits), and follows the established generator pattern already present in the codebase (e.g., how other role-like unions are defined). There is no ambiguity in intent and no design decision for a human to weigh in on beyond what the upstream API spec dictates.

Other factors

The diff is self-contained, mechanical, and consistent (the new union type constant object follows the same style as similar generated enums elsewhere in the codebase). There is no PR conversation history or third-party objections to consider, and no CLAUDE.md conventions apply. The bug-hunting pass reported no findings, consistent with the low-risk nature of type-only changes.

@wochinge
wochinge enabled auto-merge (squash) September 1, 2026 10:27
@wochinge
wochinge merged commit cd113c3 into main Sep 1, 2026
18 checks passed
@wochinge
wochinge deleted the api-spec-bot-1ea859c-33494604967-1 branch September 1, 2026 10:27
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