To help your agent avoid repeating itself when calling a tool and generating a response at the same time, you can set things up so it handles tool execution and response generation one after the other. Here are a few friendly tips to get you started:
•
Repetition Control: Try using repetition penalties in the model settings to gently discourage the agent from repeating itself.
•
Sequential Tool Execution: Configure the agent to process tool calls and responses step-by-step, making sure one finishes before the next begins.
•
System Prompt Configuration: Add clear instructions in the system prompt to keep things concise and avoid repetition.
•
Speech Handle Management: Take advantage of LiveKit’s speech handle system to manage overlapping speech and interrupt previous responses when new tool calls come in.
These tweaks help the agent recognize when a tool’s been used and keep responses neat and non-redundant. If you want, I’m happy to share some detailed examples or help you set this up!
Sources:
livekit-agents/livekit/agents/voice/agent_activity.py |
Together AI LLM integration guide | LiveKit Docs |
Perplexity LLM integration guide | LiveKit Docs