OpenAIAssistantAgent Class

Definition

Represents a Agent specialization based on Open AI Assistant / GPT.

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

Constructors

OpenAIAssistantAgent(Assistant, AssistantClient, IEnumerable<KernelPlugin>, IPromptTemplateFactory, String)

Initializes a new instance of the OpenAIAssistantAgent class.

Fields

CodeInterpreterMetadataKey

The metadata key that identifies code-interpreter content.

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

Expose client for additional use.

Definition

Gets the assistant definition.

Description

Gets the description of the agent (optional).

(Inherited from Agent)
Id

Gets the identifier of the agent (optional).

(Inherited from Agent)
Instructions

Gets the instructions for the agent (optional).

(Inherited from Agent)
IsDeleted
Obsolete.

Gets a value that indicates whether the assistant has been deleted via DeleteAsync(CancellationToken).

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

Gets the polling behavior for run processing.

RunOptions

Gets or sets the run creation options for the assistant.

Template

Gets or sets a prompt template based on the agent instructions.

(Inherited from Agent)

Methods

AddChatMessageAsync(String, ChatMessageContent, CancellationToken)
Obsolete.

Adds a message to the specified thread.

CreateAsync(OpenAIClientProvider, OpenAIAssistantDefinition, Kernel, KernelArguments, CancellationToken)
Obsolete.

Create a new OpenAIAssistantAgent.

CreateAzureOpenAIClient(ApiKeyCredential, Uri, HttpClient)

Produces an AzureOpenAIClient.

CreateAzureOpenAIClient(TokenCredential, Uri, HttpClient)

Produces an AzureOpenAIClient.

CreateChannelAsync(CancellationToken)

Produce an AgentChannel appropriate for the agent type.

(Inherited from Agent)
CreateFromTemplateAsync(OpenAIClientProvider, OpenAIAssistantCapabilities, Kernel, KernelArguments, PromptTemplateConfig, IPromptTemplateFactory, CancellationToken)
Obsolete.

Create a new OpenAIAssistantAgent.

CreateOpenAIClient(ApiKeyCredential, Uri, HttpClient)

Produces an OpenAI.OpenAIClient.

CreateOpenAIClient(Uri, HttpClient)

Produces an OpenAI.OpenAIClient.

CreateThreadAsync(CancellationToken)
Obsolete.

Creates a new assistant thread.

CreateThreadAsync(OpenAIThreadCreationOptions, CancellationToken)
Obsolete.

Creates a new assistant thread.

DeleteAsync(CancellationToken)
Obsolete.

Deletes the assistant definition.

DeleteThreadAsync(String, CancellationToken)
Obsolete.

Deletes an assistant thread.

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: yield return typeof(YourAgentChannel).FullName;

(Inherited from Agent)
GetThreadMessagesAsync(String, CancellationToken)
Obsolete.

Gets messages for a specified thread.

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(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.

InvokeAsync(ICollection<ChatMessageContent>, AgentThread, OpenAIAssistantAgentInvokeOptions, CancellationToken)

Invoke the agent with the provided message and arguments.

InvokeAsync(String, AgentThread, AgentInvokeOptions, CancellationToken)

Invoke the agent with the provided message and arguments.

(Inherited from Agent)
InvokeAsync(String, KernelArguments, Kernel, CancellationToken)
Obsolete.

Invokes the assistant on the specified thread.

InvokeAsync(String, RunCreationOptions, KernelArguments, Kernel, CancellationToken)
Obsolete.

Invokes the assistant on the specified thread.

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(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.

InvokeStreamingAsync(ICollection<ChatMessageContent>, AgentThread, OpenAIAssistantAgentInvokeOptions, CancellationToken)

Invoke the agent with the provided message and arguments.

InvokeStreamingAsync(String, AgentThread, AgentInvokeOptions, CancellationToken)

Invoke the agent with the provided message and arguments.

(Inherited from Agent)
InvokeStreamingAsync(String, KernelArguments, Kernel, ChatHistory, CancellationToken)
Obsolete.

Invokes the assistant on the specified thread with streaming response.

InvokeStreamingAsync(String, RunCreationOptions, KernelArguments, Kernel, ChatHistory, CancellationToken)
Obsolete.

Invokes the assistant on the specified thread with streaming response.

ListDefinitionsAsync(OpenAIClientProvider, CancellationToken)
Obsolete.

Retrieves a list of assistant definitions.

NotifyThreadOfNewMessage(AgentThread, ChatMessageContent, CancellationToken)

Notfiy the given thread that a new message is available.

(Inherited from Agent)
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)
RetrieveAsync(OpenAIClientProvider, String, Kernel, KernelArguments, IPromptTemplateFactory, CancellationToken)
Obsolete.

Retrieves an OpenAIAssistantAgent by identifier.

Applies to