wooden-beard-26644
08/13/2025, 4:07 PMtall-airline-16756
08/13/2025, 4:07 PMtall-airline-16756
08/13/2025, 4:07 PMllm_node
method in your agent. This lets you peek at each piece of the LLM response and skip the text if it has a tool call.
Here’s a simple example to get you started:
class CustomAgent(Agent):
async def llm_node(self, chat_ctx, tools, model_settings):
# Grab the original response from the parent class
async for chunk in super().llm_node(chat_ctx, tools, model_settings):
if isinstance(chunk, ChatChunk) and chunk.delta.tool_calls:
# Don’t speak the response if it includes a tool call
continue
yield chunk
With this approach, any response that has a tool call won’t be sent to the TTS system, so it won’t be spoken out loud. Hope this helps you out!