Udostępnij za pośrednictwem


OpenAIAssistantAgent Class

Definition

A KernelAgent specialization based on Open AI Assistant / GPT.

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

Fields

CodeInterpreterMetadataKey

Metadata key that identifies code-interpreter content.

Properties

Arguments

Optional arguments for the agent.

Definition

The assistant definition.

Description

The description of the agent (optional)

(Inherited from Agent)
Id

The identifier of the agent (optional).

(Inherited from Agent)
Instructions

The instructions of the agent (optional)

(Inherited from KernelAgent)
IsDeleted

Set when the assistant has been deleted via DeleteAsync(CancellationToken). An assistant removed by other means will result in an exception when invoked.

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)
PollingOptions

Defines polling behavior for run processing

Methods

AddChatMessageAsync(String, ChatMessageContent, CancellationToken)

Adds a message to the specified thread.

CreateAsync(Kernel, OpenAIClientProvider, OpenAIAssistantDefinition, CancellationToken)

Define a new OpenAIAssistantAgent.

CreateChannelAsync(CancellationToken)

Produce the an AgentChannel appropriate for the agent type.

(Inherited from Agent)
CreateThreadAsync(CancellationToken)

Create a new assistant thread.

CreateThreadAsync(OpenAIThreadCreationOptions, CancellationToken)

Create a new assistant thread.

DeleteAsync(CancellationToken)

Delete the assistant definition.

DeleteThreadAsync(String, CancellationToken)

Create a new assistant thread.

GetChannelKeys()

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

(Inherited from Agent)
GetThreadMessagesAsync(String, CancellationToken)

Gets messages for a specified thread.

InvokeAsync(String, KernelArguments, Kernel, CancellationToken)

Invoke the assistant on the specified thread.

InvokeAsync(String, OpenAIAssistantInvocationOptions, KernelArguments, Kernel, CancellationToken)

Invoke the assistant on the specified thread.

InvokeStreamingAsync(String, ChatHistory, KernelArguments, Kernel, CancellationToken)

Invoke the assistant on the specified thread.

InvokeStreamingAsync(String, ChatHistory, OpenAIAssistantInvocationOptions, KernelArguments, Kernel, CancellationToken)

Invoke the assistant on the specified thread.

ListDefinitionsAsync(OpenAIClientProvider, CancellationToken)

Retrieve a list of assistant definitions: OpenAIAssistantDefinition.

RetrieveAsync(Kernel, OpenAIClientProvider, String, CancellationToken)

Retrieve a OpenAIAssistantAgent by identifier.

UploadFileAsync(Stream, String, CancellationToken)

Uploads an file for the purpose of using with assistant.

Applies to