Skip to content
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 @@ -1461,8 +1461,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