Freigeben über


OpenAIAssistantAgent.CreateAsync Method

Definition

Define a new OpenAIAssistantAgent.

public static System.Threading.Tasks.Task<Microsoft.SemanticKernel.Agents.OpenAI.OpenAIAssistantAgent> CreateAsync (Microsoft.SemanticKernel.Kernel kernel, Microsoft.SemanticKernel.Agents.OpenAI.OpenAIClientProvider clientProvider, Microsoft.SemanticKernel.Agents.OpenAI.OpenAIAssistantDefinition definition, System.Threading.CancellationToken cancellationToken = default);
static member CreateAsync : Microsoft.SemanticKernel.Kernel * Microsoft.SemanticKernel.Agents.OpenAI.OpenAIClientProvider * Microsoft.SemanticKernel.Agents.OpenAI.OpenAIAssistantDefinition * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.SemanticKernel.Agents.OpenAI.OpenAIAssistantAgent>
Public Shared Function CreateAsync (kernel As Kernel, clientProvider As OpenAIClientProvider, definition As OpenAIAssistantDefinition, Optional cancellationToken As CancellationToken = Nothing) As Task(Of OpenAIAssistantAgent)

Parameters

kernel
Kernel

The Kernel containing services, plugins, and other state for use throughout the operation.

clientProvider
OpenAIClientProvider

OpenAI client provider for accessing the API service.

definition
OpenAIAssistantDefinition

The assistant definition.

cancellationToken
CancellationToken

The CancellationToken to monitor for cancellation requests. The default is None.

Returns

An OpenAIAssistantAgent instance

Applies to