green-scooter-82275
07/14/2025, 11:35 AMfunction_tool
is called in conversation_item_added
Event?tall-airline-16756
07/14/2025, 11:35 AMtall-airline-16756
07/14/2025, 11:36 AMfunction_tool
is called when a conversation_item_added
event occurs, examine the event's item
type:
• If event.item.type == "function_call"
, a function tool has been invoked. You can then check which tool (event.item.name
) and its arguments.
• If event.item.type == "function_call_output"
, this represents the result of a function tool call.
Each function tool call in a conversation triggers a conversation_item_added
event with type == "function_call"
(and subsequently function_call_output
). Inspect the event payloads to detect and track tool invocation contextualized to the conversation.
If you want a consolidated event representing function tool executions, listen for the function_tools_executed
event, which summarizes all the function calls executed in a turn.
For detailed examples of handlers, review the Python code snippets and event flow described above.
Sources: livekit-plugins/livekit-plugins-google/livekit/plugins/google/llm.py | Events and error handling | LiveKit Docs