Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/google/adk/models/lite_llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -1322,8 +1322,11 @@ async def _get_content(
elif mime_type in _SUPPORTED_FILE_CONTENT_MIME_TYPES:
# OpenAI/Azure require file_id from uploaded file, not inline data
if provider in _FILE_ID_REQUIRED_PROVIDERS:
ext = mimetypes.guess_extension(mime_type) or ".bin"
filename = f"document{ext}"

file_response = await litellm.acreate_file(
file=part.inline_data.data,
file=(filename, part.inline_data.data, mime_type),
purpose="assistants",
custom_llm_provider=provider,
)
Expand Down