adamant-gigabyte-17689
12/04/2025, 7:06 AMlively-winter-88668
12/04/2025, 10:14 AMflaky-scooter-85113
12/04/2025, 11:12 AMfresh-hospital-14455
12/04/2025, 5:30 PMadamant-gigabyte-17689
12/04/2025, 6:56 PMadamant-gigabyte-17689
12/04/2025, 6:59 PMlookup_weather tool, so the tool definitions are clearly being loaded.
However, when I then ask the model to use the tool, it keeps responding that it needs user permission before calling it. Is there a parameter or setting that allows the model to call tools directly without asking for additional user approval?
@function_tool(raw_schema=raw_schema)
async def lookup_weather(raw_arguments: dict):
"""Use this tool to look up current weather information in the given location."""
location = raw_arguments["location"]
<http://logger.info|logger.info>(f"Looking up weather for {location}")
return f"The weather in {location} is sunny with a temperature of 32 degrees Celsius."
class Assistant(Agent):
def __init__(self) -> None:
# --- 2. Pass the tool list to the parent Agent class ---
super().__init__(
tools=[lookup_weather], # <--- Tools go here
instructions="""
# Role & Objective
You are a **CUSTOMER** with persona:
Your goal is to role-play this CUSTOMER realistically.
# Context (INTERNAL ONLY)
- **YOUR Profile:**
# Information Disclosure Policy
- **KEEP IT SECRET:** Do NOT voluntarily share personal details.
- **WAIT FOR QUESTIONS:** Only reveal details if asked.
# Handling Unclear Audio
- **Language Rule:** Always respond in **Thai**.
# Voice & Audio Guidelines
- **Speaking Style:** Speak naturally.
- **Fillers:** Use natural Thai fillers ("อ่า...", "เอ่อ...", "ครับ").
You can tell user what tools do you have and how to use them when appropriate.
"""
)
server = AgentServer()
@server.rtc_session()
async def my_agent(ctx: JobContext):
ctx.log_context_fields = {
"room": ctx.room.name,
}
# Note: We do NOT pass tools to the model config here.
# The Agent class handles passing them from the 'tools' list in __init__
model = google.realtime.RealtimeModel(
model="gemini-2.5-flash-native-audio-preview-09-2025",
thinking_config=types.ThinkingConfig(
include_thoughts=False,
),
# modalities=["TEXT", "AUDIO"],
proactivity=True,
realtime_input_config=types.RealtimeInputConfig(
automatic_activity_detection=types.AutomaticActivityDetection(),
),
)
session = AgentSession(
llm=model,
)fresh-hospital-14455
12/05/2025, 6:10 AMgemini-live-2.5-flash-preview. I have found this gemini model to be better with tool calling. This should work, let me know how it goes.adamant-gigabyte-17689
12/06/2025, 4:30 PM