Skip to content

fix: accept Azure assistant file ids#5759

Open
he-yufeng wants to merge 2 commits into
google:mainfrom
he-yufeng:fix/azure-assistant-file-id
Open

fix: accept Azure assistant file ids#5759
he-yufeng wants to merge 2 commits into
google:mainfrom
he-yufeng:fix/azure-assistant-file-id

Conversation

@he-yufeng
Copy link
Copy Markdown

Fixes #5664.

Summary

This updates the LiteLLM file-id path to treat Azure assistant-* ids the same way it already treats file-* ids for OpenAI/Azure providers.

Without this, an Azure-uploaded assistant file id can fall through the file URI fallback path instead of being sent as a Responses API file content block.

Verification

Ran locally on Windows:

python -m py_compile src\google\adk\models\lite_llm.py tests\unittests\models\test_litellm.py
uv run --extra dev pyink --check src\google\adk\models\lite_llm.py tests\unittests\models\test_litellm.py
uv run --no-sync python -m pytest tests\unittests\models\test_litellm.py -q -k "assistant_file_id or file_id_required_preserves_file_id" -o cache_dir=.tmp\pytest-cache
git diff --check

Result:

3 passed, 257 deselected

Note: uv run --extra test ... is currently blocked for me on Windows because the locked yarl==1.24.1 resolution has no Windows wheel. I installed the minimal target-test dependencies in the local venv and ran the focused test path above.

@he-yufeng he-yufeng force-pushed the fix/azure-assistant-file-id branch from 6c74218 to 90a0e69 Compare May 20, 2026 04:54
@adk-bot adk-bot added the models [Component] Issues related to model support label May 20, 2026
@rohityan rohityan self-assigned this May 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

models [Component] Issues related to model support

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Title LiteLlm: Azure OpenAI file_id with assistant- prefix bypasses Responses-API content block

3 participants