馃敶 Required Information
Describe the Bug:
In the OpenAI-compatible (Chat Completions) path of ApigeeLlm, CompletionsHTTPClient._content_to_messages drops every non-tool part of a Content that also contains a function_response. Text parts are collected into content_parts, but the if function_responses: branch returns the tool messages (plus any tool-attached media) without ever using content_parts, so the text never reaches the model.
LiteLlm had the same issue and now sends the remaining parts as a follow-up message after the tool messages (lite_llm.py, _content_to_message_param).
Steps to Reproduce:
pip install google-adk==2.11.0
- Run the snippet below.
Expected Behavior:
The tool message, followed by a user message carrying the text:
[{"role": "tool", "tool_call_id": "call_1", "content": "{\"ok\": 1}"},
{"role": "user", "content": "Also, please summarize in French."}]
Observed Behavior:
The text is silently dropped:
[{"role": "tool", "tool_call_id": "call_1", "content": "{\"ok\": 1}"}]
Environment Details:
- ADK Library Version: 2.11.0 (also reproduced on
main at 3d11f9f)
- Desktop OS: macOS
- Python Version: 3.12.13
Model Information:
- Are you using LiteLLM: No
- Which model is being used:
ApigeeLlm in Chat Completions mode (any OpenAI-compatible backend)
馃煛 Optional Information
Minimal Reproduction Code:
import json
from google.genai import types
from google.adk.models.apigee_llm import CompletionsHTTPClient
client = CompletionsHTTPClient(base_url="http://test")
content = types.Content(role="user", parts=[
types.Part(function_response=types.FunctionResponse(
id="call_1", name="f", response={"ok": 1})),
types.Part(text="Also, please summarize in French."),
])
print(json.dumps(client._content_to_messages(content)))
How often has this issue occurred?:
Proposed fix: In the function_responses branch, append the remaining content_parts to the follow-up user message (alongside any tool-attached media), collapsing to a plain string when it is a single text part, as the non-tool branch already does. I have a PR ready with unit tests.
馃敶 Required Information
Describe the Bug:
In the OpenAI-compatible (Chat Completions) path of
ApigeeLlm,CompletionsHTTPClient._content_to_messagesdrops every non-tool part of aContentthat also contains afunction_response. Text parts are collected intocontent_parts, but theif function_responses:branch returns the tool messages (plus any tool-attached media) without ever usingcontent_parts, so the text never reaches the model.LiteLlm had the same issue and now sends the remaining parts as a follow-up message after the tool messages (
lite_llm.py,_content_to_message_param).Steps to Reproduce:
pip install google-adk==2.11.0Expected Behavior:
The tool message, followed by a user message carrying the text:
Observed Behavior:
The text is silently dropped:
Environment Details:
mainat 3d11f9f)Model Information:
ApigeeLlmin Chat Completions mode (any OpenAI-compatible backend)馃煛 Optional Information
Minimal Reproduction Code:
How often has this issue occurred?:
Proposed fix: In the
function_responsesbranch, append the remainingcontent_partsto the follow-up user message (alongside any tool-attached media), collapsing to a plain string when it is a single text part, as the non-tool branch already does. I have a PR ready with unit tests.