Replies: 5 comments
-
I am also getting the same warning when after running the example: https://google.github.io/adk-docs/tools/#example |
Beta Was this translation helpful? Give feedback.
-
This is a warning so it may not be a problem. Does the agent still behave like it should? |
Beta Was this translation helpful? Give feedback.
-
The code runs as expected, for each agent I see the same warning. I have observed the same behavior in other code as well. |
Beta Was this translation helpful? Give feedback.
-
You can use python's logging to silence this warning: import logging
from google.adk.agents import LlmAgent
from google.adk.sessions import InMemorySessionService
from google.adk.runners import Runner
from google.genai import types
import dotenv
dotenv.load_dotenv()
class _NoToolNoise(logging.Filter):
def filter(self, record: logging.LogRecord) -> bool:
return record.getMessage() != "Warning: there are non-text parts in the response: ['function_call'],returning concatenated text result from text parts,check out the non text parts for full response from model."
logging.getLogger("google_genai.types").addFilter(_NoToolNoise())
def tool() -> str:
"""Returns a test string"""
return {"response": "test string"}
agent= LlmAgent(
name="agent",
model="gemini-2.0-flash",
tools=[tool]
)
runner = Runner(agent=agent, session_service=InMemorySessionService(), app_name="exploration")
runner.session_service.create_session(
app_name="exploration",
user_id="admin",
session_id=f"session_1"
)
message = types.Content(role="user", parts=[types.Part(text="use the tool")])
for event in runner.run(session_id="session_1", user_id="admin",
new_message=message):
if event.is_final_response():
print(event.content.parts[0].text) Tested with google-adk 0.4.0 This code assumes there's a .env file present with a valid GOOGLE_API_KEY variable in it. |
Beta Was this translation helpful? Give feedback.
-
I am seeing this error when I would be expecting a function call. My guess is that Gemini is returning a text response AND a function call (for example, a text response "I will create your reservation" and the This breaks my code since I'm expecting one or the other. |
Beta Was this translation helpful? Give feedback.
-
I get this error depiste only ever passing in and return strings in Agents and Tools.
Warning: there are non-text parts in the response: ['function_call'],returning concatenated text result from text parts,check out the non text parts for full response from model.
Beta Was this translation helpful? Give feedback.
All reactions