Udostępnij za pośrednictwem


ChatCompletionAgent Class

Definition

A KernelAgent specialization based on IChatCompletionService.

public sealed class ChatCompletionAgent : Microsoft.SemanticKernel.Agents.ChatHistoryKernelAgent
type ChatCompletionAgent = class
    inherit ChatHistoryKernelAgent
Public NotInheritable Class ChatCompletionAgent
Inherits ChatHistoryKernelAgent
Inheritance

Remarks

NOTE: Enable OpenAIPromptExecutionSettings.FunctionChoiceBehavior for agent plugins. (Arguments)

Constructors

ChatCompletionAgent()

Properties

Arguments

Optional arguments for the agent.

(Inherited from ChatHistoryKernelAgent)
Description

The description of the agent (optional)

(Inherited from Agent)
HistoryReducer (Inherited from ChatHistoryKernelAgent)
Id

The identifier of the agent (optional).

(Inherited from Agent)
Instructions

The instructions of the agent (optional)

(Inherited from KernelAgent)
Kernel

The Kernel containing services, plugins, and filters for use throughout the agent lifetime.

(Inherited from KernelAgent)
Logger

The ILogger associated with this Agent.

(Inherited from Agent)
LoggerFactory

A ILoggerFactory for this Agent.

(Inherited from Agent)
Name

The name of the agent (optional)

(Inherited from Agent)

Methods

CreateChannelAsync(CancellationToken)

Produce the an AgentChannel appropriate for the agent type.

(Inherited from ChatHistoryKernelAgent)
GetChannelKeys()

Set of keys to establish channel affinity. Minimum expected key-set: yield return typeof(YourAgentChannel).FullName;

(Inherited from ChatHistoryKernelAgent)
InvokeAsync(ChatHistory, KernelArguments, Kernel, CancellationToken) System.Object.InvokeAsync(Microsoft.SemanticKernel.ChatCompletion.ChatHistory,Microsoft.SemanticKernel.KernelArguments,Microsoft.SemanticKernel.Kernel,System.Threading.CancellationToken)
InvokeStreamingAsync(ChatHistory, KernelArguments, Kernel, CancellationToken) System.Object.InvokeStreamingAsync(Microsoft.SemanticKernel.ChatCompletion.ChatHistory,Microsoft.SemanticKernel.KernelArguments,Microsoft.SemanticKernel.Kernel,System.Threading.CancellationToken)
ReduceAsync(ChatHistory, CancellationToken)

Reduce the provided history

(Inherited from ChatHistoryKernelAgent)

Applies to