Skip to content

fix: tolerate partial LiteLLM citations#3655

Draft
devin-lai wants to merge 1 commit into
openai:mainfrom
devin-lai:fix/litellm-citation-annotations
Draft

fix: tolerate partial LiteLLM citations#3655
devin-lai wants to merge 1 commit into
openai:mainfrom
devin-lai:fix/litellm-citation-annotations

Conversation

@devin-lai

Copy link
Copy Markdown

Summary

Fix LiteLLM citation annotation conversion so provider-shaped partial URL citations do not raise KeyError or produce unusable empty citations. The converter now preserves valid citation data, defaults missing title and index fields safely, skips entries without citation URLs, and returns None when no usable citations remain.

Test plan

  • uv run pytest tests/models/test_litellm_annotations.py
  • PATH="/usr/bin:/bin:/usr/sbin:/sbin:/Users/ldy/.local/bin:/Users/ldy/miniforge3/bin:/opt/homebrew/bin" bash .agents/skills/code-change-verification/scripts/run.sh

Issue number

N/A

Checks

  • I've added new tests (if relevant)
  • I've added/updated the relevant documentation
  • I've run make lint and make format
  • I've made sure tests pass

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants