Who it is forA team shipping a voice agent that must behave predictably.
The problemVoice Agents change behavior silently when prompts or models change.
The outcomePytest tests that fail when the agent stops calling the expected tool.
What you need first
- Python with pip
- A LiveKit server or LiveKit Cloud project
- API keys for the model providers you choose
Steps
- Install pytest and your agent's dependencies
- Write an async test that starts AgentSession with your agent, as in the README
- Send a user_input with sess.run and assert the expected function call
- Run the suite with
uv run pytest --unitin the repo, or pytest in your project
Prompt for your agent
Using livekit/agents, write a pytest test like the README's test_no_availability that checks my agent calls <my tool> when the user says <phrase>, and run it.
Caveat. Tests that use a real LLM call the provider and can be slow or flaky.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for livekit/agents and "Write tests for your agent's behavior"
Add Deduped to Claude Code once
claude mcp add --transport http deduped https://dedupedai.com/mcp
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer