AIContextProvider.InvokedContext Constructors

Definition

Overloads

AIContextProvider.InvokedContext(AIAgent, AgentSession, IEnumerable<ChatMessage>, IEnumerable<ChatMessage>)

Initializes a new instance of the AIContextProvider.InvokedContext class for a successful invocation.

public InvokedContext(Microsoft.Agents.AI.AIAgent agent, Microsoft.Agents.AI.AgentSession? session, System.Collections.Generic.IEnumerable<Microsoft.Extensions.AI.ChatMessage> requestMessages, System.Collections.Generic.IEnumerable<Microsoft.Extensions.AI.ChatMessage> responseMessages);
new Microsoft.Agents.AI.AIContextProvider.InvokedContext : Microsoft.Agents.AI.AIAgent * Microsoft.Agents.AI.AgentSession * seq<Microsoft.Extensions.AI.ChatMessage> * seq<Microsoft.Extensions.AI.ChatMessage> -> Microsoft.Agents.AI.AIContextProvider.InvokedContext
Public Sub New (agent As AIAgent, session As AgentSession, requestMessages As IEnumerable(Of ChatMessage), responseMessages As IEnumerable(Of ChatMessage))

Parameters

agent
AIAgent

The agent that was invoked.

session
AgentSession

The session associated with the agent invocation.

requestMessages
IEnumerable<ChatMessage>

The accumulated request messages (user input, chat history and any others provided by AI context providers) that were used by the agent for this invocation.

responseMessages
IEnumerable<ChatMessage>

The response messages generated during this invocation.

Exceptions

agent, requestMessages, or responseMessages is null.

Applies to

AIContextProvider.InvokedContext(AIAgent, AgentSession, IEnumerable<ChatMessage>, Exception)

Initializes a new instance of the AIContextProvider.InvokedContext class for a failed invocation.

public InvokedContext(Microsoft.Agents.AI.AIAgent agent, Microsoft.Agents.AI.AgentSession? session, System.Collections.Generic.IEnumerable<Microsoft.Extensions.AI.ChatMessage> requestMessages, Exception invokeException);
new Microsoft.Agents.AI.AIContextProvider.InvokedContext : Microsoft.Agents.AI.AIAgent * Microsoft.Agents.AI.AgentSession * seq<Microsoft.Extensions.AI.ChatMessage> * Exception -> Microsoft.Agents.AI.AIContextProvider.InvokedContext
Public Sub New (agent As AIAgent, session As AgentSession, requestMessages As IEnumerable(Of ChatMessage), invokeException As Exception)

Parameters

agent
AIAgent

The agent that was invoked.

session
AgentSession

The session associated with the agent invocation.

requestMessages
IEnumerable<ChatMessage>

The accumulated request messages (user input, chat history and any others provided by AI context providers) that were used by the agent for this invocation.

invokeException
Exception

The exception that caused the invocation to fail.

Exceptions

agent, requestMessages, or invokeException is null.

Applies to