get a notification when we begin to call LLM (open...
# ask-ai
c
get a notification when we begin to call LLM (openai._base_client - DEBUG - Request options: {'method': 'post', 'url': '/chat/completions', 'files': None, 'json_data':) before the answer, before llm_node using AgentSession
t
Thanks for reaching out, Antoine. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
When using
AgentSession
to call a language model (LLM), you can set up notifications for various events using event handlers with the
@self._session.on()
decorator. Key notifications include: • Speech-related events: Notifications for when speech starts, stops, or is transcribed. • Function call events: Notifications for when function calls are collected or finished. • Response events: Notifications for when response content is complete. • Metrics events: Notifications for when metrics are collected. These events allow you to monitor and handle different stages of the interaction with the LLM effectively. Sources: livekit.agents.multimodal.multimodal_agent API documentation | livekit.agents.multimodal.multimodal_agent API documentation
c
their is only EventTypes = Literal[ "user_state_changed", "agent_state_changed", "user_input_transcribed", "conversation_item_added", "function_tools_executed", "metrics_collected", "speech_created", "error", "close", ]
t
The
EventTypes
in
AgentSession
are defined as follows: •
user_state_changed
agent_state_changed
user_input_transcribed
conversation_item_added
function_tools_executed
metrics_collected
speech_created
error
close
These events are used to handle various stages and actions within the session effectively. Sources: Tree View: | dse-workbench