Skip to content

Interactions API drops media a tool returns (FunctionResponse.parts) #7884

Closed

Description

@adityasingh2400

🔴 Required Information

Describe the Bug:
With Gemini(use_interactions_api=True), media a tool returns never reaches the model. ADK moves a tool's types.Part media (images, PDFs and so on) into FunctionResponse.parts. _convert_part_to_interaction_content builds the function_result step only from FunctionResponse.response, so the parts are dropped silently. The model then answers about a chart or report it never saw.

The other model adapters already forward these parts: LiteLlm, AnthropicLlm, ApigeeLlm and the OCI integration all read function_response.parts. The Interactions API accepts media in a function result as a list of contents. google-genai declares image there in every supported release, and adds audio, video and document in 2.33.

Steps to Reproduce:

  1. Use Gemini(model="gemini-3-flash-preview", use_interactions_api=True) with a FunctionTool that returns {"metric": ..., "chart": types.Part.from_bytes(data=png, mime_type="image/png"), "report": types.Part.from_bytes(data=pdf, mime_type="application/pdf")}.
  2. Let the model call the tool, then inspect the next request's function_result step.

Expected Behavior:
The function_result carries the JSON response plus the image and the PDF.

Observed Behavior:
With a real google-genai client (2.34.0) and an httpx.MockTransport that records requests:

FunctionResponse.parts: [('image/png', 18), ('application/pdf', 20)]
function_result on the wire: {'call_id': 'call-1', 'result': {'metric': 'latency'}, 'is_error': False, 'name': 'render_report', 'type': 'function_result'}

Environment Details:

  • ADK Library Version (pip show google-adk): 2.13.0 (also on main at e9e8f61)
  • Desktop OS: macOS
  • Python Version (python -V): 3.11.16

Model Information:

  • Are you using LiteLLM: No
  • Which model is being used: Gemini (gemini-3-flash-preview) through the Interactions API

🟡 Optional Information

Minimal Reproduction Code:

from google.adk.models import interactions_utils
from google.genai import types

part = types.Part(
    function_response=types.FunctionResponse(
        id="call-1",
        name="render_report",
        response={"metric": "latency"},
        parts=[
            types.FunctionResponsePart(
                inline_data=types.FunctionResponseBlob(
                    mime_type="image/png", data=b"\x89PNG..."
                )
            )
        ],
    )
)
print(interactions_utils._convert_part_to_interaction_content(part))
# {'type': 'function_result', ..., 'result': {'metric': 'latency'}}  <- no image

How often has this issue occurred?:

  • Always (100%), whenever a tool returns media on the Interactions API

Activity

  1. self-assigned this
    on Nov 2, 2026
  2. added theissue type on Nov 2, 2026
  3. sanketpatil06 commented on Nov 4, 2026

    @sanketpatil06

    Hi @adityasingh2400, thank you for raising this issue along with clear details and reproduction steps. We have reproduced the issue on the latest main branch. We also appreciate you submitting PR #7885 to fix it, the team will review it. Thank you for your patience and understanding.

  4. adk-bot commented on Nov 5, 2026

    @adk-bot
    Collaborator

    Resolved by #7885 (imported and merged in commit 80bd338). Closing issue.

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

Metadata

Metadata

Assignees

Labels

tools[Component] This issue is related to tools

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions