Skip to content

ApigeeLlm (Chat Completions): text sent alongside a function_response is silently dropped聽#7475

Description

@AkshayShah03

馃敶 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:

  1. pip install google-adk==2.11.0
  2. 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?:

  • Always (100%)

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.

Activity

  1. added a commit that references this issue on Oct 9, 2026
    ef816e3
  2. added a commit that references this issue on Oct 9, 2026
    f5db310
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions