Share via


AgentApplicationBuilder class

Builder class for creating and configuring AgentApplication instances.

Methods

build()

Builds and returns a new AgentApplication instance configured with the provided options.

withAuthorization(AuthorizationHandlers)

Sets authentication options for the AgentApplication.

withStorage(Storage)

Sets the storage provider for the AgentApplication.

withTurnStateFactory(() => TState)

Sets the factory function to create new TurnState instances.

Method Details

build()

Builds and returns a new AgentApplication instance configured with the provided options.

function build(): AgentApplication<TState>

Returns

A new AgentApplication instance

withAuthorization(AuthorizationHandlers)

Sets authentication options for the AgentApplication.

function withAuthorization(authHandlers: AuthorizationHandlers): AgentApplicationBuilder<TState>

Parameters

authHandlers
AuthorizationHandlers

The user identity authentication options

Returns

This builder instance for chaining

withStorage(Storage)

Sets the storage provider for the AgentApplication.

function withStorage(storage: Storage): AgentApplicationBuilder<TState>

Parameters

storage
Storage

The storage implementation to use

Returns

This builder instance for chaining

withTurnStateFactory(() => TState)

Sets the factory function to create new TurnState instances.

function withTurnStateFactory(turnStateFactory: () => TState): AgentApplicationBuilder<TState>

Parameters

turnStateFactory

() => TState

Function that creates a new TurnState

Returns

This builder instance for chaining