Share via


AgentClient class

Client for communicating with other agents through HTTP requests. Manages configuration, authentication, and activity exchange with target agents.

Constructors

AgentClient(string)

Creates a new instance of the AgentClient class.

Properties

agentClientConfig

Configuration settings for the agent client

Methods

postActivity(Activity, AuthConfiguration, ConversationState, TurnContext)

Sends an activity to another agent and handles the conversation state.

Constructor Details

AgentClient(string)

Creates a new instance of the AgentClient class.

new AgentClient(agentConfigKey: string)

Parameters

agentConfigKey

string

The name of the agent, used to locate configuration in environment variables

Property Details

agentClientConfig

Configuration settings for the agent client

agentClientConfig: AgentClientConfig

Property Value

Method Details

postActivity(Activity, AuthConfiguration, ConversationState, TurnContext)

Sends an activity to another agent and handles the conversation state.

function postActivity(activity: Activity, authConfig: AuthConfiguration, conversationState: ConversationState, context: TurnContext): Promise<string>

Parameters

activity
Activity

The activity to send to the target agent

authConfig
AuthConfiguration

Authentication configuration used to obtain access tokens

conversationState
ConversationState

State manager to store conversation data

context
TurnContext

The current turn context

Returns

Promise<string>

A promise that resolves to the HTTP status text of the agent response