m
hi
t
Thanks for reaching out, Rahib. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
I'd love to help you out! Could you please share a bit more about your question or the issue you're experiencing? That way, I can assist you better.
m
What are different ways to transfer call to a human agent on telephony.
t
I'd love to walk you through the different ways to transfer a call to a human agent on telephony in LiveKit. Here are some options you can explore: • Cold Transfer: You can use the
transfer_sip_participant
API to directly transfer the call to another number. This method removes the agent from the call right after the transfer is initiated. • DTMF-Triggered Transfers: Calls can be transferred based on DTMF input (like pressing numbers on the keypad). This is a handy way to route calls to specific departments. • Warm Handoff: By using the
create_sip_participant
API, you can add a human agent to the call. The AI agent can stay on the call initially to provide helpful context before leaving. • Advanced Warm Transfer: This involves a multi-step process where a supervisor room is used. The agent provides context to the human agent before the call is transferred, ensuring a smooth handoff. • Function Tool-Based Transfers: You can create custom tools to handle transfer requests programmatically, tailoring the process to your needs. Each of these methods has its own strengths, depending on whether you want to give the human agent some background or prefer a direct transfer. If you'd like, I’m happy to guide you through detailed steps for any of these options—just let me know! Sources: agent.py | agent.py | telephony/warm_handoff.py | examples/warm-transfer/warm_transfer.py | Agent-assisted warm transfer | LiveKit Docs
m
how to implement and deploy this with my existing after hours support agent ? Advanced Warm Transfer: This involves a multi-step process where a supervisor room is used. The agent provides context to the human agent before the call is transferred, ensuring a smooth handoff.
t
To help you smoothly implement and deploy the Advanced Warm Transfer with a supervisor room for your after-hours support agent, here’s a friendly step-by-step guide: 1. Set Up Telephony Requirements: First, make sure you have both inbound and outbound SIP trunks configured. The outbound trunk lets your agent call the supervisor, while the inbound trunk handles incoming customer calls. 2. Configure Environment Variables: Next, set up important variables like the outbound SIP trunk ID and the supervisor’s phone number. For example:
Copy code
LIVEKIT_SIP_OUTBOUND_TRUNK="ST_abcxyz"
LIVEKIT_SUPERVISOR_PHONE_NUMBER="+12003004000"
3. Implement the Workflow: ◦ Start by placing the customer on hold with some background music to keep things pleasant. ◦ Create a supervisor room and dial the supervisor using the
create_sip_participant
API. ◦ Share a summary of the call with the supervisor using the conversation history to keep them in the loop. ◦ Then, move the supervisor into the customer room with the
move_participant
API. ◦ Finally, disconnect the AI agent once the supervisor has joined the call. 1. Deploy the Agent: Use the LiveKit CLI to deploy your agent with the right dispatch configuration. 2. Test the System: It’s always good to test! Use the Agent Playground to try out the warm transfer functionality and make sure everything is running smoothly. If you’d like, I’m happy to provide detailed code snippets or help you with any of these steps. Just let me know! Sources: Agent-assisted warm transfer | LiveKit Docs | examples/README.md
m
When using the agent playground by livekit in the Chat is it possible to also push the tool calls when agent is deciding on that? Or only chat goes in there ?
t
Thank you for reaching out! LiveKit's Agent Playground is a wonderful tool designed to help you interact with agents through video, audio, and chat. While it does keep track of tool calls and their results as part of the conversation, it’s not entirely clear if the Agent Playground UI shows these tool calls live during the agent’s decision-making process. To make sure I’m giving you the best support possible, could you please share a bit more about what you’re hoping to see? • Are you interested in seeing tool calls appear in the chat interface as they happen? • Would you like to watch the agent’s "thinking" state while tools are running? • Are you aiming to debug the tool execution flow in real-time? • Or maybe you want to customize how these tool calls show up in the playground? Once I understand your specific needs, I’ll be happy to guide you through what’s possible and how to get there. Looking forward to hearing from you! Sources: livekit-plugins/livekit-plugins-aws/livekit/plugins/aws/experimental/realti... | livekit/agent/livekit_agent_session.pb.go | README.md
m
Yes i want the tool calls appear in the chat interface of the playground.
t
I'm glad you're exploring LiveKit's framework! It wonderfully supports tracking tool calls and their outputs, which you can seamlessly integrate into a chat interface. These tool calls are thoughtfully logged as events and included in the chat context with clear item types, like
function_call
for the tool call itself and
function_call_output
for the result. To help you display tool calls in the Agent Playground chat interface, here are some friendly steps you can follow: • Capture tool execution events such as
FunctionToolsExecutedEvent
, which give you all the details about the tool call and its output. • Use callbacks to keep track of the tool calls as they happen and add them to the chat log in real-time. • Integrate the tool call data from the chat context into your UI, so both the call and its output are clearly shown. If you'd like, I’m here to help you implement this in your specific setup. Just share a bit about your Agent Playground environment and the kind of interface you're working with, and we can figure it out together! Sources: agents/src/voice/agent_activity.ts | livekit-plugins/livekit-plugins-aws/livekit/plugins/aws/experimental/realti...
m
I am just using livekit playground repo cloned it and deployed it for internal testing.
t
I'd be happy to help you display tool calls in the chat interface of the LiveKit Agent Playground! Here’s a simple way to get started: 1. Listen for Tool Events: You can subscribe to the
FunctionToolsExecuted
event to catch tool calls and their outputs as they happen. For example:
Copy code
session.on("function_tools_executed", (event) => {
  event.functionCalls.forEach(call => displayToolCall(call));
  event.functionCallOutputs.forEach(output => displayToolOutput(output));
});
2. Parse Chat Context Items: When you’re showing the chat history, keep an eye out for items with the types
function_call
and
function_call_output
. These help you display the tool calls and their results smoothly. 3. Track Tool Execution State: During tool execution, you can use the agent’s "thinking" state to show loading indicators. This way, users know something is happening behind the scenes. If you’d like, I’m here to provide more detailed guidance or specific code examples tailored just for your playground setup. Just let me know! Sources: examples/voice_agents/dynamic_tool_creation.py | agents/src/voice/agent_activity.ts