Partilhar via


OpenAIAssistantAgent.RetrieveAsync Method

Definition

Caution

Use the OpenAI.Assistants.AssistantClient to retrieve an assistant definition (GetAssistantsAsync). This method will be removed after May 1st 2025.

Retrieves an OpenAIAssistantAgent by identifier.

[System.Obsolete("Use the OpenAI.Assistants.AssistantClient to retrieve an assistant definition (GetAssistantsAsync). This method will be removed after May 1st 2025.")]
public static System.Threading.Tasks.Task<Microsoft.SemanticKernel.Agents.OpenAI.OpenAIAssistantAgent> RetrieveAsync(Microsoft.SemanticKernel.Agents.OpenAI.OpenAIClientProvider clientProvider, string id, Microsoft.SemanticKernel.Kernel kernel, Microsoft.SemanticKernel.KernelArguments? defaultArguments = default, Microsoft.SemanticKernel.IPromptTemplateFactory? templateFactory = default, System.Threading.CancellationToken cancellationToken = default);
[<System.Obsolete("Use the OpenAI.Assistants.AssistantClient to retrieve an assistant definition (GetAssistantsAsync). This method will be removed after May 1st 2025.")>]
static member RetrieveAsync : Microsoft.SemanticKernel.Agents.OpenAI.OpenAIClientProvider * string * Microsoft.SemanticKernel.Kernel * Microsoft.SemanticKernel.KernelArguments * Microsoft.SemanticKernel.IPromptTemplateFactory * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.SemanticKernel.Agents.OpenAI.OpenAIAssistantAgent>
Public Shared Function RetrieveAsync (clientProvider As OpenAIClientProvider, id As String, kernel As Kernel, Optional defaultArguments As KernelArguments = Nothing, Optional templateFactory As IPromptTemplateFactory = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of OpenAIAssistantAgent)

Parameters

clientProvider
OpenAIClientProvider

The configuration for accessing the API service.

id
String

The agent identifier.

kernel
Kernel

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

defaultArguments
KernelArguments

Optional default arguments, including any PromptExecutionSettings.

templateFactory
IPromptTemplateFactory

An optional factory to produce the IPromptTemplate for the agent.

cancellationToken
CancellationToken

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

Returns

An OpenAIAssistantAgent instance.

Attributes

Applies to