LoopContext Constructor

Definition

Initializes a new instance of the LoopContext class.

public LoopContext(Microsoft.Agents.AI.AIAgent agent, Microsoft.Agents.AI.AgentSession session, System.Collections.Generic.IReadOnlyList<Microsoft.Extensions.AI.ChatMessage> initialMessages, Microsoft.Agents.AI.AgentResponse lastResponse, Microsoft.Agents.AI.AgentRunOptions? runOptions = default);
new Microsoft.Agents.AI.LoopContext : Microsoft.Agents.AI.AIAgent * Microsoft.Agents.AI.AgentSession * System.Collections.Generic.IReadOnlyList<Microsoft.Extensions.AI.ChatMessage> * Microsoft.Agents.AI.AgentResponse * Microsoft.Agents.AI.AgentRunOptions -> Microsoft.Agents.AI.LoopContext
Public Sub New (agent As AIAgent, session As AgentSession, initialMessages As IReadOnlyList(Of ChatMessage), lastResponse As AgentResponse, Optional runOptions As AgentRunOptions = Nothing)

Parameters

agent
AIAgent

The wrapped AIAgent that is being looped.

session
AgentSession

The AgentSession used for the loop.

initialMessages
IReadOnlyList<ChatMessage>

The messages passed in for the first iteration of the loop.

lastResponse
AgentResponse

The AgentResponse produced by the iteration that just completed.

runOptions
AgentRunOptions

The AgentRunOptions that were passed to the loop run, if any.

Exceptions

agent, session, initialMessages, or lastResponse is null.

Applies to