My multiagent voice workflow keeps mentioning that...
# ask-ai
w
My multiagent voice workflow keeps mentioning that we are transferring between one agent to the next. How can I prevent this?
t
Thanks for reaching out, John. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Transfer announcements in multiagent voice workflows are typically implemented at the application level through explicit calls to speech methods before performing transfers. To prevent these announcements, you need to modify the transfer handling code in your agents. Here’s how you can do it: 1. Remove or comment out the announcement calls: Identify and remove any lines in your code that explicitly generate transfer announcements. For example, remove calls like
await self.say()
or
await ctx.session.generate_reply()
that include transfer messages. 2. Modify the transfer methods to perform silent transfers: Ensure that the transfer methods do not include any announcement logic. For instance:
Copy code
async def _handle_transfer(self, identity: str, transfer_number: str, department: str):
    # Remove this line: await self.say(f"Transferring you to our {department} department in a moment. Please hold.")
    # Remove this line: await asyncio.sleep(6)
    await self.transfer_call(identity, transfer_number)
1. For multi-agent transfers, return empty announcement strings: Modify the transfer logic to return an empty string instead of a transfer message. For example:
Copy code
async def _transfer_to_agent(self, name: str, context: RunContext_T):
    userdata = context.userdata
    current_agent = context.session.current_agent
    next_agent = userdata.agents[name]
    userdata.prev_agent = current_agent
    return next_agent, ""  # Empty string instead of transfer message
By implementing these changes, you can ensure that transfers occur silently without any announcements.
🙌 1