<https://github.com/livekit-examples/python-agents...
# ask-ai
s
https://github.com/livekit-examples/python-agents-examples/blob/main/complex-agents/medical_office_triage/triage.py I am running this using'python triage.py console', and only one agent can speak, while the others never get a turn. Can you please tell me what the issue is, and what I'm doing wrong?
t
Thanks for reaching out, Rishabh. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
In the LiveKit Python example
triage.py
, only one agent speaks at a time because the system is thoughtfully designed to have a single active agent per session. When you run
python triage.py console
, the Triage Agent starts as the sole active speaker. Other agents, like the Support Agent or Billing Agent, will step in only when they’re explicitly called upon through a transfer function based on the user’s request. To have other agents speak, you’ll want to trigger a transfer under specific conditions. For instance, the Triage Agent can hand things over to the Support Agent for medical service requests or to the Billing Agent for financial inquiries. These transfers happen through the
_transfer_to_agent
method in the
BaseAgent
class, which smoothly switches the active agent while keeping the context intact. If you’d like, I’m here to help walk you through setting up these transfers or answer any questions you might have! Sources: complex-agents/personal_shopper/README.md
s
Yes, i ask about the billing, it says billing agent will connect and nothing happnes.
t
I'm sorry to hear that the Billing Agent isn't connecting when you ask about billing. Let's work through a few steps together to get this sorted out: 1. First, please double-check that your
.env
file includes all the necessary API keys:
OPENAI_API_KEY
,
DEEPGRAM_API_KEY
, and
CARTESIA_API_KEY
. 2. Next, take a look at the logs to see if the system is correctly recognizing your billing-related question and triggering the
transfer_to_billing
function. 3. Also, ensure your inquiry clearly mentions a billing issue, since the Triage Agent needs to distinguish between medical and billing topics. If you’re still having trouble after these steps, please feel free to share your library version (
pip freeze | grep livekit
), Python version, and any relevant logs. I’m here to help you get this resolved! Sources: complex-agents/personal_shopper/personal_shopper.py | Still Have Questions
s
ok. its working
t
I'm so happy to hear that it's working for you now! If you ever have any more questions or need a hand with anything else, please don't hesitate to reach out. I'm here to help!