Table of Contents

Class LiveKitAgentDispatchService

Namespace
LiveKit.Services
Assembly
LiveKit.AspNetCore.ServerSdk.dll

Service for managing agent dispatches to rooms.

Provides methods for dispatching AI agents to rooms based on room configuration or on-demand. See Agent Dispatch Documentation for more information.

public sealed class LiveKitAgentDispatchService : TwirpClient, ILiveKitAgentDispatchService
Inheritance
LiveKitAgentDispatchService
Implements
Inherited Members

Constructors

LiveKitAgentDispatchService(HttpClient, ILogger<LiveKitAgentDispatchService>, ILiveKitTokenService)

Initializes a new instance of the LiveKitAgentDispatchService class.

public LiveKitAgentDispatchService(HttpClient httpClient, ILogger<LiveKitAgentDispatchService> logger, ILiveKitTokenService _tokenService)

Parameters

httpClient HttpClient
logger ILogger<LiveKitAgentDispatchService>
_tokenService ILiveKitTokenService

Methods

CreateDispatchAsync(CreateAgentDispatchRequest, CancellationToken)

Creates a new agent dispatch for a room.

public Task<AgentDispatch> CreateDispatchAsync(CreateAgentDispatchRequest request, CancellationToken cancellationToken = default)

Parameters

request CreateAgentDispatchRequest
cancellationToken CancellationToken

Returns

Task<AgentDispatch>

Exceptions

LiveKitApiException

Thrown when the server returns a non-success HTTP status code.

DeleteDispatchAsync(DeleteAgentDispatchRequest, CancellationToken)

Deletes an agent dispatch.

public Task<AgentDispatch> DeleteDispatchAsync(DeleteAgentDispatchRequest request, CancellationToken cancellationToken = default)

Parameters

request DeleteAgentDispatchRequest
cancellationToken CancellationToken

Returns

Task<AgentDispatch>

Exceptions

LiveKitApiException

Thrown when the server returns a non-success HTTP status code.

ListDispatchAsync(ListAgentDispatchRequest, CancellationToken)

Lists agent dispatches for a room.

public Task<ListAgentDispatchResponse> ListDispatchAsync(ListAgentDispatchRequest request, CancellationToken cancellationToken = default)

Parameters

request ListAgentDispatchRequest
cancellationToken CancellationToken

Returns

Task<ListAgentDispatchResponse>

Exceptions

LiveKitApiException

Thrown when the server returns a non-success HTTP status code.