Class AgentDispatchServiceClient
- Namespace
- Livekit.Server.Sdk.Dotnet
- Assembly
- LivekitApi.dll
Client of the LiveKit Agent Dispatch service: dispatches agents to rooms explicitly, lists and deletes those dispatches.
public class AgentDispatchServiceClient : BaseService
- Inheritance
-
AgentDispatchServiceClient
- Inherited Members
Constructors
AgentDispatchServiceClient(string, string, string, HttpClient)
Creates the client.
public AgentDispatchServiceClient(string host, string apiKey = null, string apiSecret = null, HttpClient client = null)
Parameters
hoststringURL of the LiveKit server,
http(s)://orws(s)://; a subpath such ashttps://host/livekitis kept.apiKeystringAPI key; the
LIVEKIT_API_KEYenvironment variable when omitted.apiSecretstringAPI secret; the
LIVEKIT_API_SECRETenvironment variable when omitted.clientHttpClientOptional HttpClient to send the requests with. The SDK never modifies it, so it can be shared with other clients and code.
Methods
CreateDispatch(CreateAgentDispatchRequest)
Dispatches an agent to a room.
public Task<AgentDispatch> CreateDispatch(CreateAgentDispatchRequest request)
Parameters
requestCreateAgentDispatchRequestRoom, agent name and optional metadata for the agent.
Returns
- Task<AgentDispatch>
The created dispatch.
DeleteDispatch(DeleteAgentDispatchRequest)
Deletes an agent dispatch.
public Task<AgentDispatch> DeleteDispatch(DeleteAgentDispatchRequest request)
Parameters
requestDeleteAgentDispatchRequestDispatch ID and room.
Returns
- Task<AgentDispatch>
The deleted dispatch.
GetDispatch(string, string)
Gets an agent dispatch by its ID, or null when it does not exist.
public Task<AgentDispatch> GetDispatch(string dispatchId, string roomName)
Parameters
Returns
- Task<AgentDispatch>
The dispatch, or null when the room has no dispatch with that ID.
ListDispatch(ListAgentDispatchRequest)
Lists the agent dispatches of a room.
public Task<ListAgentDispatchResponse> ListDispatch(ListAgentDispatchRequest request)
Parameters
requestListAgentDispatchRequestRoom name, and optionally a dispatch ID to match.
Returns
- Task<ListAgentDispatchResponse>
The dispatches of the room.