OpenAIAssistantAgent.CreateAsync Method
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.
Caution
Use the OpenAI.Assistants.AssistantClient to create an assistant (CreateAssistantAsync). This method will be removed after May 1st 2025.
Create a new OpenAIAssistantAgent.
[System.Obsolete("Use the OpenAI.Assistants.AssistantClient to create an assistant (CreateAssistantAsync). This method will be removed after May 1st 2025.")]
public static System.Threading.Tasks.Task<Microsoft.SemanticKernel.Agents.OpenAI.OpenAIAssistantAgent> CreateAsync(Microsoft.SemanticKernel.Agents.OpenAI.OpenAIClientProvider clientProvider, Microsoft.SemanticKernel.Agents.OpenAI.OpenAIAssistantDefinition definition, Microsoft.SemanticKernel.Kernel kernel, Microsoft.SemanticKernel.KernelArguments? defaultArguments = default, System.Threading.CancellationToken cancellationToken = default);
[<System.Obsolete("Use the OpenAI.Assistants.AssistantClient to create an assistant (CreateAssistantAsync). This method will be removed after May 1st 2025.")>]
static member CreateAsync : Microsoft.SemanticKernel.Agents.OpenAI.OpenAIClientProvider * Microsoft.SemanticKernel.Agents.OpenAI.OpenAIAssistantDefinition * Microsoft.SemanticKernel.Kernel * Microsoft.SemanticKernel.KernelArguments * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.SemanticKernel.Agents.OpenAI.OpenAIAssistantAgent>
Public Shared Function CreateAsync (clientProvider As OpenAIClientProvider, definition As OpenAIAssistantDefinition, kernel As Kernel, Optional defaultArguments As KernelArguments = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of OpenAIAssistantAgent)
Parameters
- clientProvider
- OpenAIClientProvider
The OpenAI client provider for accessing the API service.
- definition
- OpenAIAssistantDefinition
The assistant definition.
- kernel
- Kernel
The Kernel containing services, plugins, and other state for use throughout the operation.
- defaultArguments
- KernelArguments
Optional default arguments, including any PromptExecutionSettings.
- cancellationToken
- CancellationToken
The CancellationToken to monitor for cancellation requests. The default is None.
Returns
An OpenAIAssistantAgent instance.
- Attributes