Skip to content

feat(api): update API spec from langfuse/langfuse 58667f4 - #2107

Closed
langfuse-bot wants to merge 1 commit into
mainfrom
api-spec-bot-58667f4-42217349288-1
Closed

langfuse-bot wants to merge 1 commit into
mainfrom
api-spec-bot-58667f4-42217349288-1

Conversation

@langfuse-bot

@langfuse-bot langfuse-bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Collaborator

Generated from langfuse/langfuse main at 58667f4.

RetriggerView in GreptileConfidence Score: 5/5

The PR appears safe to merge; no actionable defects were found.

Summary

Updates the generated API client from Langfuse commit 58667f4.

  • Python callers can read Topics rules and see which rules run each facet.
  • Callers can page through trace summaries and current topic assignments.
  • Observation pages can be short or empty while a cursor remains.
  • Model descriptions now mark tokenizer fields as legacy.

No actionable issues were found. Runtime tests were not run.

Reviews (1) · Last reviewed commit: "feat(api): update API spec from langfuse..." · Reviewed by Greptile

@langfuse-bot
langfuse-bot requested a review from sumerman November 6, 2026 12:26
@github-actions

github-actions Bot commented Nov 6, 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.

Claude Code Review

No review was started: this request came from a bot account. Manual reviews can only be requested by someone with write access to this repository. Ask a maintainer to comment @claude review, or have your automation post the comment from a user account with write access.

Tip: disable this comment in your organization's Code Review settings.

Comment on lines +22 to +24
rule_ids: typing_extensions.Annotated[
typing.List[str], FieldMetadata(alias="ruleIds")
] = pydantic.Field()

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔴 SDK users pointed at a Langfuse server that predates this spec get a pydantic ValidationError from list_facets/get_facet, where the base SDK parsed the response fine. TopicFacet.rule_ids is declared as a required List[str] with no default. An older server's facet payload has no ruleIds key. Fix: make the field tolerate its absence, for example typing.Optional[typing.List[str]] = None or a default of [], so older self-hosted servers still parse. The fix belongs in the upstream spec, marked optional or defaulted, so the generator emits it that way.

Why this was flagged

The trigger is a self-hosted or older Langfuse server whose /api/public/unstable/topic-facets responses were built before the rules change and have no ruleIds. Those responses go through parse_obj_as(type_=TopicFacetList, ...) in langfuse/api/unstable/topics/raw_client.py. On pydantic v2 that calls TypeAdapter.validate_python (langfuse/api/core/pydantic_utilities.py:58-59), which raises a ValidationError for the missing required field. After upgrading, the caller gets an exception for list_facets and get_facet in both the sync and async clients. On the base branch the same response parsed into TopicFacet. extra="allow" does not help, because it only covers unknown keys, not missing required ones. The other new rule-related fields in this diff, Topic.rule_id and TopicFacetCounts.rule_id, are Optional with default None, so only rule_ids has this problem.

Verification: langfuse/api/unstable/topics/types/topic_facet.py:22-24 adds rule_ids with a bare pydantic.Field(), so the field is required. The base TopicFacet had no rule_ids field. list_facets and get_facet parse with parse_obj_as (raw_client.py:112, 291), which raises a ValidationError when ruleIds is missing. extra="allow" only tolerates extra keys, not missing ones.

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