This message was deleted.
# ask-ai
s
This message was deleted.
t
Thanks for reaching out, Aleh. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
You can absolutely integrate LiveKit's agent dispatch API with AWS Lambda to run agents on dispatch requests, and I'd be happy to guide you through it! Here's a friendly overview of how you can get started: • Use the LiveKit API's
create_dispatch
method to dispatch agents. This handy method lets you assign a named agent to a specific room and even pass along metadata like JSON to the agent. • Within AWS Lambda, you can work with the Python or Node.js SDK to connect with the LiveKit API. Just be sure to set up your environment variables for API credentials (
LIVEKIT_API_KEY
,
LIVEKIT_API_SECRET
, and
LIVEKIT_URL
). • Make sure your Lambda function gracefully handles asynchronous operations, such as using
asyncio
in Python, to keep things running smoothly. • You can trigger the Lambda function however fits your needs best—maybe through API Gateway or other AWS services. If you'd like, I'm here to help with a sample Lambda function implementation or walk you through setting up the environment step-by-step. Just let me know! Sources: examples/agent_dispatch.py | packages/livekit-server-sdk/src/AgentDispatchClient.ts | lib/livekit/agent_dispatch_service_client.rb | examples/agent_dispatch/src/main.rs | Agent dispatch | LiveKit Docs
b
dispatch is supposed that i already have running agent i wont to move flow a bit trough my api send metadata to lambda in lambda start agent and then dispatch it with metadata
t
To help you achieve your goal of starting an agent dynamically in AWS Lambda and dispatching it with metadata, here’s a friendly approach you can follow: • Use your API to send metadata to AWS Lambda. This metadata might include important details like the room name, agent name, and any other context that your agent will need. • Inside the Lambda function, you can initialize the agent dynamically and then use the LiveKit API's
create_dispatch
method to send the agent to a room, along with the metadata you provided. • Make sure the agent is registered with an
agent_name
in its configuration. This is key because it disables automatic dispatch and gives you full control over when and how the agent is dispatched. • When you dispatch, pass the metadata as a JSON string. Your agent will then be able to access this metadata through its
JobContext
, making it easier to handle the task. If you’d like, I’d be happy to walk you through a detailed example of the Lambda function or help you set up the agent configuration. Just let me know! Sources: livekit-api/livekit/api/agent_dispatch_service.py | Job lifecycle | LiveKit Docs | avatars/hedra/dynamically_created_avatar/agent.py | Agent dispatch | LiveKit Docs | packages/livekit-server-sdk/src/AgentDispatchClient.ts