Skip to content

Handle pydantic url_citation annotations from newer OpenAI SDK#254

Merged
probably-jaden merged 1 commit into
mainfrom
fix/extract-citations-pydantic-annotations
May 12, 2026
Merged

Handle pydantic url_citation annotations from newer OpenAI SDK#254
probably-jaden merged 1 commit into
mainfrom
fix/extract-citations-pydantic-annotations

Conversation

@probably-jaden
Copy link
Copy Markdown
Contributor

@probably-jaden probably-jaden commented May 12, 2026

Summary

  • Coerce pydantic Annotation objects from the newer OpenAI SDK via model_dump() before the existing dict-based extraction path in GeneralLlm._extract_citations.
  • Behavior is unchanged for current litellm versions that still wrap annotations as dicts; this just makes the function forward-compatible.

The OpenAI SDK now returns url_citation annotations as pydantic Annotation
objects instead of dicts. Coerce via model_dump() so the existing dict-based
extraction path continues to work for both old and new SDK shapes.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@probably-jaden probably-jaden merged commit 56cea3b into main May 12, 2026
2 checks passed
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