Table of Contents

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

host string

URL of the LiveKit server, http(s):// or ws(s)://; a subpath such as https://host/livekit is kept.

apiKey string

API key; the LIVEKIT_API_KEY environment variable when omitted.

apiSecret string

API secret; the LIVEKIT_API_SECRET environment variable when omitted.

client HttpClient

Optional 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

request CreateAgentDispatchRequest

Room, 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

request DeleteAgentDispatchRequest

Dispatch 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

dispatchId string

ID of the dispatch.

roomName string

Room the dispatch belongs to.

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

request ListAgentDispatchRequest

Room name, and optionally a dispatch ID to match.

Returns

Task<ListAgentDispatchResponse>

The dispatches of the room.