Skip to content

Cannot send attach file to OpenAI throw LiteLlm #2862

Closed

Description

@Lin-Nikaido

** Please make sure you read the contribution guide and file the issues in the right place. **
Contribution guide.

Describe the bug
Send create request to litellm -> OpenAI with attached file. But I get litellm.exceptions.BadRequestError: litellm.BadRequestError: AzureException BadRequestError - Missing required parameter: 'messages[1].content[1].file.file_id'.

Expected behavior

File "/home/ec2-user/pythonProjects/trust2/apis/conversation.py", line 128, in session_loop
    async for event in event_iter:
File "/home/ec2-user/pythonProjects/trust2/venv/lib/python3.10/site-packages/google/adk/runners.py", line 248, in run_async
    async for event in agen:
File "/home/ec2-user/pythonProjects/trust2/venv/lib/python3.10/site-packages/google/adk/runners.py", line 244, in _run_with_trace
    async for event in agen:
File "/home/ec2-user/pythonProjects/trust2/venv/lib/python3.10/site-packages/google/adk/runners.py", line 288, in _exec_with_plugin
    async for event in agen:
File "/home/ec2-user/pythonProjects/trust2/venv/lib/python3.10/site-packages/google/adk/runners.py", line 238, in execute
    async for event in agen:
File "/home/ec2-user/pythonProjects/trust2/venv/lib/python3.10/site-packages/google/adk/agents/base_agent.py", line 248, in run_async
    async for event in agen:
File "/home/ec2-user/pythonProjects/trust2/venv/lib/python3.10/site-packages/google/adk/agents/base_agent.py", line 238, in _run_with_trace
    async for event in agen:
File "/home/ec2-user/pythonProjects/trust2/venv/lib/python3.10/site-packages/google/adk/agents/llm_agent.py", line 288, in _run_async_impl
    async for event in agen:
File "/home/ec2-user/pythonProjects/trust2/venv/lib/python3.10/site-packages/google/adk/flows/llm_flows/base_llm_flow.py", line 401, in run_async
    async for event in agen:
File "/home/ec2-user/pythonProjects/trust2/venv/lib/python3.10/site-packages/google/adk/flows/llm_flows/base_llm_flow.py", line 437, in _run_one_step_async
    async for llm_response in agen:
File "/home/ec2-user/pythonProjects/trust2/venv/lib/python3.10/site-packages/google/adk/flows/llm_flows/base_llm_flow.py", line 769, in _call_llm_async
    async for event in agen:
File "/home/ec2-user/pythonProjects/trust2/venv/lib/python3.10/site-packages/google/adk/flows/llm_flows/base_llm_flow.py", line 753, in _call_llm_with_tracing
    async for llm_response in agen:
File "/home/ec2-user/pythonProjects/trust2/venv/lib/python3.10/site-packages/google/adk/flows/llm_flows/base_llm_flow.py", line 945, in _run_and_handle_error
    raise model_error
File "/home/ec2-user/pythonProjects/trust2/venv/lib/python3.10/site-packages/google/adk/flows/llm_flows/base_llm_flow.py", line 929, in _run_and_handle_error
    async for response in agen:
File "/home/ec2-user/pythonProjects/trust2/venv/lib/python3.10/site-packages/google/adk/models/lite_llm.py", line 767, in generate_content_async
    async for part in await self.llm_client.acompletion(**completion_args):
File "/home/ec2-user/pythonProjects/trust2/venv/lib/python3.10/site-packages/google/adk/models/lite_llm.py", line 105, in acompletion
    return await acompletion(
File "/home/ec2-user/pythonProjects/trust2/venv/lib/python3.10/site-packages/litellm/utils.py", line 1516, in wrapper_async
    raise e
File "/home/ec2-user/pythonProjects/trust2/venv/lib/python3.10/site-packages/litellm/utils.py", line 1374, in wrapper_async
    result = await original_function(*args, **kwargs)
File "/home/ec2-user/pythonProjects/trust2/venv/lib/python3.10/site-packages/litellm/main.py", line 544, in acompletion
    raise exception_type(
File "/home/ec2-user/pythonProjects/trust2/venv/lib/python3.10/site-packages/litellm/litellm_core_utils/exception_mapping_utils.py", line 2284, in exception_type
    raise e
File "/home/ec2-user/pythonProjects/trust2/venv/lib/python3.10/site-packages/litellm/litellm_core_utils/exception_mapping_utils.py", line 2027, in exception_type
    raise BadRequestError(
litellm.exceptions.BadRequestError: litellm.BadRequestError: AzureException BadRequestError - Missing required parameter: 'messages[1].content[1].file.file_id'.

Desktop (please complete the following information):

  • OS: Amazon Linux 2023
  • Python version(python -V): 3.12
  • ADK version(pip show google-adk): 1.13.0

Model Information:
OpenAI GPT4o

Additional context
Add any other context about the problem here.

Activity

  1. added theissue type on Sep 5, 2025
  2. llalitkumarrr commented on Nov 25, 2025

    @llalitkumarrr
    Collaborator

    Hello @Lin-Nikaido

    We recommend trying out our latest release i.e. google-adk==1.19.0 and check if you still face this issue. And if you are still struggling with this, could you please share some additional information about the issue so we can understand it better? A minimal reproducible code sample and the steps to reproduce the problem would be extremely helpful for us to analyze it more effectively.

  3. added
    request clarification[Status] The maintainer need clarification or more information from the author
    on Nov 25, 2025
  4. removed
    request clarification[Status] The maintainer need clarification or more information from the author
    on Nov 25, 2025
  5. added
    request clarification[Status] The maintainer need clarification or more information from the author
    on Nov 25, 2025
  6. adk-bot commented on Dec 3, 2025

    @adk-bot
    Collaborator

    This issue has been automatically marked as stale because it has not had recent activity for 7 days after a maintainer requested clarification. It will be closed if no further activity occurs within 7 days.

  7. added
    stale[Status] Issues which have been marked inactive since there is no user response
    on Dec 3, 2025
  8. adk-bot commented on Dec 12, 2025

    @adk-bot
    Collaborator

    This has been automatically closed because it has been marked as stale for over 7 days.

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

Metadata

Metadata

Assignees

Labels

models[Component] This issue is related to model supportrequest clarification[Status] The maintainer need clarification or more information from the authorstale[Status] Issues which have been marked inactive since there is no user response

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions