m
hi
t
Thanks for reaching out, aigentzi. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Hi — thanks for reaching out. How can I help you today? If you’re reporting an issue, please share: • What you’re trying to do (e.g., create/join a room, record, stream) • Any error messages or unexpected behavior • SDK/language and LiveKit server version you’re using • Room ID, session ID, or a short reproduction steps (if available) If you’re asking about something else, tell me what you need and I’ll guide you.
m
van you create the revised full agent.py Thanks • Use async methods: implement persona lifecycle hooks as
async def
(e.g.,
async def on_enter(self)
and
async def respond(self, message)
), because the agent framework and session I/O are asynchronous. • Read dispatch metadata from
ctx.job.metadata
(a JSON string). Parse it with
json.loads(ctx.job.metadata)
and read the "persona" key. If that matches your worker, I’ll produce the full async
agent.py
with all 11 persona classes, starter prompts, persona registry, and an entrypoint that reads
ctx.job.metadata
. If your worker uses a different job variable name or a different metadata path, paste the small entrypoint snippet and I’ll match it exactly. Sources: Agents and handoffs | LiveKit docs | Job lifecycle | LiveKit docs | Agent dispatch | LiveKit docs Zak [1:38 PM] Here’s the snippet from agent/main.py showing how the worker receives and handles each job dispatch: async def entrypoint(_ctx_: JobContext): """ Agent entrypoint - called when agent is dispatched to a room """ logger.info(f"Agent {AGENT_NAME} connecting to room {ctx.job.room.name}") # Connect to the room await ctx.connect(_auto_subscribe_=AutoSubscribe.AUDIO_ONLY) # Parse job metadata metadata = parse_metadata(ctx.job.metadata or "{}") scenario = metadata.get("scenario", "teaching") logger.info(f"Job metadata: {metadata}") logger.info(f"Scenario: {scenario}") # ... configure assistant and start session ... This shows the JobContext object (ctx) providing ctx.job and ctx.job.metadata, which is where your dispatch metadata (like persona/scenario) currently comes from.
t
Thanks — I can create the async
agent.py
that: • Implements async lifecycle hooks (
async def on_enter
,
async def respond
, etc.) • Parses dispatch metadata from
ctx.job.metadata
via
json.loads(...)
• Matches the entrypoint snippet you pasted Before I produce the full file, I need one thing from you: please paste the 11 persona names and their starter prompts (one-line or paragraph each) or point me to the exact text you want used for each persona. If you don't have them, tell me if you want example personas (I can create sensible defaults) or a shorter set to start with. Sources: Agents and handoffs | LiveKit docs | Agent dispatch | LiveKit docs | External data and RAG | LiveKit Docs
m
English Teacher — “Hello — I'm Alex, your English teacher. How would you like to practice today?” Taxi Driver — “Hi there — where would you like me to take you today?” Hotel Receptionist — “Welcome! Do you have a reservation, or would you like to check in?” Waiter — “Hello — I’ll be your waiter today. What would you like to order?” Check-in Agent — “Good morning — may I have your name and passport to begin check-in?” Border Officer — “Passport, please — what is the purpose of your visit today?” Nurse — “Hello — what brings you in today? Tell me briefly how you’re feeling.” Ticket Clerk — “Hi — where are you traveling today, and what time would you like your ticket?” Information Agent — “How can I help you today? What information are you looking for?” Museum Front Desk — “Welcome to the museum — would you like a map or a suggestion on where to start?” Bartender — “What can I get you today? Any drink or taste you prefer?”
t
I don't have the answer you're looking for. You could also try asking your question: • in one of the other Slack channels or • to https://deepwiki.com/livekit/livekit_composite which is trained on all LiveKit source code If you find the answer, please post it here to help others!
m
how do we obtain an agent subdomain ?