Share via


DelegatingAIAgent.RunCoreStreamingAsync Method

Definition

Core implementation of the agent streaming invocation logic with a collection of chat messages.

protected override System.Collections.Generic.IAsyncEnumerable<Microsoft.Agents.AI.AgentResponseUpdate> RunCoreStreamingAsync(System.Collections.Generic.IEnumerable<Microsoft.Extensions.AI.ChatMessage> messages, Microsoft.Agents.AI.AgentSession? session = default, Microsoft.Agents.AI.AgentRunOptions? options = default, System.Threading.CancellationToken cancellationToken = default);
override this.RunCoreStreamingAsync : seq<Microsoft.Extensions.AI.ChatMessage> * Microsoft.Agents.AI.AgentSession * Microsoft.Agents.AI.AgentRunOptions * System.Threading.CancellationToken -> System.Collections.Generic.IAsyncEnumerable<Microsoft.Agents.AI.AgentResponseUpdate>
Protected Overrides Function RunCoreStreamingAsync (messages As IEnumerable(Of ChatMessage), Optional session As AgentSession = Nothing, Optional options As AgentRunOptions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As IAsyncEnumerable(Of AgentResponseUpdate)

Parameters

messages
IEnumerable<ChatMessage>

The collection of messages to send to the agent for processing.

session
AgentSession

The conversation session to use for this invocation. If null, a new session will be created. The session will be updated with the input messages and any response updates generated during invocation.

options
AgentRunOptions

Optional configuration parameters for controlling the agent's invocation behavior.

cancellationToken
CancellationToken

The CancellationToken to monitor for cancellation requests. The default is None.

Returns

An asynchronous enumerable of AgentResponseUpdate instances representing the streaming response.

Applies to