ChatHistoryAgent Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Represents a Agent specialization bound to a Microsoft.SemanticKernel.Agents.ChatHistoryChannel.
public abstract class ChatHistoryAgent : Microsoft.SemanticKernel.Agents.Agent
type ChatHistoryAgent = class
inherit Agent
Public MustInherit Class ChatHistoryAgent
Inherits Agent
- Inheritance
- Derived
Remarks
NOTE: Enable FunctionChoiceBehavior for agent plugins (Arguments).
Constructors
ChatHistoryAgent() |
Properties
ActiveLoggerFactory |
Get the active logger factory, if defined; otherwise, provide the default. (Inherited from Agent) |
Arguments |
Gets the arguments for the agent instruction parameters (optional). (Inherited from Agent) |
Description |
Gets the description of the agent (optional). (Inherited from Agent) |
HistoryReducer |
Gets an optional IChatHistoryReducer to reduce the history. |
Id |
Gets the identifier of the agent (optional). (Inherited from Agent) |
Instructions |
Gets the instructions for the agent (optional). (Inherited from Agent) |
Kernel |
Gets the Kernel containing services, plugins, and filters for use throughout the agent lifetime. (Inherited from Agent) |
Logger |
The ILogger associated with this Agent. (Inherited from Agent) |
LoggerFactory |
A ILoggerFactory for this Agent. (Inherited from Agent) |
Name |
Gets the name of the agent (optional). (Inherited from Agent) |
Template |
Gets or sets a prompt template based on the agent instructions. (Inherited from Agent) |
Methods
CreateChannelAsync(CancellationToken) |
Produce an AgentChannel appropriate for the agent type. |
EnsureThreadExistsWithMessagesAsync<TThreadType>(ICollection<ChatMessageContent>, AgentThread, Func<TThreadType>, CancellationToken) |
Ensures that the thread exists, is of the expected type, and is active, plus adds the provided message to the thread. (Inherited from Agent) |
GetChannelKeys() |
Set of keys to establish channel affinity. Minimum expected key-set: <example> yield return typeof(YourAgentChannel).FullName; </example> |
InvokeAsync(AgentThread, AgentInvokeOptions, CancellationToken) |
Invoke the agent with no message assuming that all required instructions are already provided to the agent or on the thread. (Inherited from Agent) |
InvokeAsync(ChatHistory, KernelArguments, Kernel, CancellationToken) |
Obsolete.
Invokes the assistant to respond to the provided history. |
InvokeAsync(ChatMessageContent, AgentThread, AgentInvokeOptions, CancellationToken) |
Invoke the agent with the provided message and arguments. (Inherited from Agent) |
InvokeAsync(ICollection<ChatMessageContent>, AgentThread, AgentInvokeOptions, CancellationToken) |
Invoke the agent with the provided message and arguments. (Inherited from Agent) |
InvokeAsync(String, AgentThread, AgentInvokeOptions, CancellationToken) |
Invoke the agent with the provided message and arguments. (Inherited from Agent) |
InvokeStreamingAsync(AgentThread, AgentInvokeOptions, CancellationToken) |
Invoke the agent with no message assuming that all required instructions are already provided to the agent or on the thread. (Inherited from Agent) |
InvokeStreamingAsync(ChatHistory, KernelArguments, Kernel, CancellationToken) |
Obsolete.
Invokes the assistant to respond to the provided history with streaming response. |
InvokeStreamingAsync(ChatMessageContent, AgentThread, AgentInvokeOptions, CancellationToken) |
Invoke the agent with the provided message and arguments. (Inherited from Agent) |
InvokeStreamingAsync(ICollection<ChatMessageContent>, AgentThread, AgentInvokeOptions, CancellationToken) |
Invoke the agent with the provided message and arguments. (Inherited from Agent) |
InvokeStreamingAsync(String, AgentThread, AgentInvokeOptions, CancellationToken) |
Invoke the agent with the provided message and arguments. (Inherited from Agent) |
NotifyThreadOfNewMessage(AgentThread, ChatMessageContent, CancellationToken) |
Notfiy the given thread that a new message is available. (Inherited from Agent) |
ReduceAsync(ChatHistory, CancellationToken) |
Reduces the provided history. |
RenderInstructionsAsync(Kernel, KernelArguments, CancellationToken) |
Formats the system instructions for the agent. (Inherited from Agent) |
RestoreChannelAsync(String, CancellationToken) |
Produce an AgentChannel appropriate for the agent type based on the provided state. (Inherited from Agent) |