I am using Agent Dispatch to assign an agent to a ...
# ask-ai
a
I am using Agent Dispatch to assign an agent to a room and passing metadata when creating the dispatch. How can I access this metadata in my VoicePipelineAgent?
t
Thanks for reaching out, Jayendra. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
You can access metadata in your
VoicePipelineAgent
when using Agent Dispatch by utilizing the
AgentCallContext
class. Here’s how you can do it: 1. Get the current
AgentCallContext
using the static method:
context = AgentCallContext.get_current()
2. Retrieve metadata using the
get_metadata
method:
value = context.get_metadata("key", default=None)
You can also store metadata using:
Copy code
context.store_metadata("key", value)
The
AgentCallContext
maintains a dictionary of metadata that can be used to store and retrieve information during agent execution. Sources: livekit.agents.pipeline.pipeline_agent API documentation
a
How can I get the metadata from the frontend room or job context?
t
Unfortunately, I couldn't find specific information on how to retrieve metadata from the frontend room or job context during Agent Dispatch. The available documentation primarily focuses on accessing metadata within the
AgentCallContext
class. If you need further assistance, I recommend consulting the LiveKit documentation or reaching out to a developer familiar with your implementation for more detailed guidance. Sources: livekit.agents.pipeline API documentation | Dispatching agents | LiveKit Docs | AgentCallContext | LiveKit Agents
a
How to get remote participant metadata in the VoicePipelineAgent?
t
I'm sorry, but I couldn't find specific information on how to retrieve remote participant metadata in the
VoicePipelineAgent
. This might require further exploration of the LiveKit documentation or assistance from a developer familiar with your setup.