Skip to content

can_use_output_schema_with_tools with tools using LiteLLM #5130

Closed

Description

@condorcet

Describe the Bug:
In ADK 1.27.0 can_use_output_schema_with_tools now returns true unconditionally in case of using LiteLLM.

While it can works with some providers (e.g. OpenAI), looks like in general it can mislead.

For example, in case vLLM and Qwen with thinking the behavior changed completely: the LLM returns structured output, but without expected tool calls. Meanwhile we see that reasoning part contains something like this:

I need to call `cx_get_guidance(section='order_management_refunds')` first to understand the refund process and what information I need.

After getting guidance, I may need to:
- Check customer's recent purchases to identify the cancelled one
- Get purchase details if I can identify it

Let me start with getting the guidance.

So the LLM inference tool call, but looks like output schema take precedence and return structured output immediately without further tool calls.

ModelResponse(id='chatcmpl-bcc5ab3b1b83e8dd', created=1775249582, model='dashscope/hosted_vllm/Qwen/Qwen3.5-397B-A17B-FP8', object='chat.completion', system_fingerprint=None, choices=[Choices(finish_reason='stop', index=0, message=Message(content='{\n  "escalation_reason": "N/A",\n  "reply": "<reply_from_llm>",\n  "to_escalate": false\n}', role='assistant', tool_calls=None, function_call=None, reasoning_content='Let me analyze this step by step.\n\n**STEP 1: Read Input & Context**\n- Customer is female (sex: \'Female\')\n- ...

It's not reproducing with thinking=off in Qwen what might suggest that behavior depends on LLM configuration / usage usecase and cannot just rely on isinstance(model, LiteLlm).

Steps to Reproduce:
Please provide a numbered list of steps to reproduce the behavior:

  1. Install 'pip install google-adk==1.27.0'
  2. Create agent with output_schema and tools
  3. Use LiteLLM with local model (e.g. Qwen)
  4. Check the result doesn't contain tool calls

Expected Behavior:
LLM returns tool calls with structured output even if it's not supported by LLM.

Observed Behavior:
LLM can omit tools calls when output schema defined.

Environment Details:

  • ADK Library Version: 1.27.0
  • Desktop OS: macOS
  • Python Version (python -V): 3.12.10

Model Information:

  • Are you using LiteLLM: Yes
  • Which model is being used: Qwen3.5-397B-A17B-FP8 with thinking

Activity

  1. added
    models[Component] This issue is related to model support
    on Apr 3, 2026
  2. added theissue type on Apr 3, 2026
  3. kedar49 commented on Apr 5, 2026

    @kedar49

    @Jacksunwei assign me this issue, Will work on this

  4. xuanyang15 commented on Apr 10, 2026

    @xuanyang15
    Collaborator

    @GWeale Could you please help take a look or assign to @kedar49?

  5. removed their assignment
    on Apr 10, 2026
  6. kedar49 commented on Apr 10, 2026

    @kedar49

    @xuanyang15 , @GWeale Yes, Assign me this

  7. GWeale commented on Sep 3, 2026

    @GWeale
    Collaborator

    closing as a duplicate of #6954, which is the same gate.

    LiteLlm.capabilities reports output_schema_and_tools=True for every model it wraps, whatever that model can actually do. so adk applies the response schema directly and never falls back to SetModelResponseTool. that's still true on main and in both current releases, so there's nothing to upgrade to yet. #6955 is the open fix.

    yours is the older report by five months, and #6954 doesn't have your qwen and vllm data point. paste it over there.

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 support

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions