mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-10 03:28:53 +00:00
fix(tests): host PDF fixture via jsDelivr with proper application/pdf MIME
Raw github serves application/octet-stream which OpenAI/Gemini reject when LiteLLM fetches the URL client-side. jsDelivr serves the same file with content-type: application/pdf. Pin to a commit SHA so the asset is immutable and jsDelivr can cache it for a year.
This commit is contained in:
parent
c05c865a1c
commit
965185c106
1 changed files with 11 additions and 4 deletions
|
|
@ -401,10 +401,17 @@ class BaseLLMChatTest(ABC):
|
|||
{
|
||||
"type": "file",
|
||||
"file": {
|
||||
# GitHub-hosted fixture (small, deterministic, reliably
|
||||
# fetchable from Anthropic's egress) instead of a Wikipedia
|
||||
# URL that intermittently returns 400 "Unable to download".
|
||||
"file_id": "https://raw.githubusercontent.com/BerriAI/litellm/main/tests/llm_translation/fixtures/dummy.pdf"
|
||||
# jsDelivr serves the repo's tests/llm_translation/fixtures/dummy.pdf
|
||||
# with `Content-Type: application/pdf`. Two reasons we don't
|
||||
# use raw.githubusercontent.com or upload.wikimedia.org:
|
||||
# - raw GitHub returns Content-Type: application/octet-stream,
|
||||
# which OpenAI/Gemini reject when LiteLLM fetches the URL
|
||||
# client-side and forwards the bytes.
|
||||
# - Wikimedia URLs intermittently return 400 from Anthropic's
|
||||
# server-side URL fetcher.
|
||||
# The URL is pinned to a specific commit SHA so jsDelivr can
|
||||
# serve it as immutable (cache-control: immutable, max-age=1y).
|
||||
"file_id": "https://cdn.jsdelivr.net/gh/BerriAI/litellm@aab3ef8988b12d166b20356a81c53127480f1125/tests/llm_translation/fixtures/dummy.pdf"
|
||||
},
|
||||
},
|
||||
]
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue