boundless-truck-87206
08/03/2025, 5:55 PMtall-airline-16756
08/03/2025, 5:55 PMtall-airline-16756
08/03/2025, 5:56 PMllm_node function in the Agent class is invoked as part of the agent's processing pipeline. Specifically, it is called by the _llm_inference_task function, which is triggered during the execution of the _pipeline_reply_task. This task coordinates various operations, including transcription, LLM inference, and TTS.
In this flow, the _pipeline_reply_task calls perform_llm_inference, which starts the _llm_inference_task. The _llm_inference_task then executes the llm_node method, passing the chat_ctx (chat context) along with other parameters like tools and model settings to process the context and generate responses.
This ensures that the llm_node is dynamically integrated into the agent's pipeline to handle LLM interactions effectively.
Sources: livekit-agents/livekit/agents/voice/agent_activity.py