AssistantClientExtensions.CreateAssistantFromTemplateAsync Method

Definition

Creates an assistant from a template asynchronously with the specified options.

public static System.Threading.Tasks.Task<OpenAI.Assistants.Assistant> CreateAssistantFromTemplateAsync(this OpenAI.Assistants.AssistantClient client, string modelId, Microsoft.SemanticKernel.PromptTemplateConfig config, bool enableCodeInterpreter = false, System.Collections.Generic.IReadOnlyList<string>? codeInterpreterFileIds = default, bool enableFileSearch = false, string? vectorStoreId = default, float? temperature = default, float? topP = default, OpenAI.Assistants.AssistantResponseFormat? responseFormat = default, System.Collections.Generic.IReadOnlyDictionary<string,string>? metadata = default, System.Threading.CancellationToken cancellationToken = default);
static member CreateAssistantFromTemplateAsync : OpenAI.Assistants.AssistantClient * string * Microsoft.SemanticKernel.PromptTemplateConfig * bool * System.Collections.Generic.IReadOnlyList<string> * bool * string * Nullable<single> * Nullable<single> * OpenAI.Assistants.AssistantResponseFormat * System.Collections.Generic.IReadOnlyDictionary<string, string> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<OpenAI.Assistants.Assistant>
<Extension()>
Public Function CreateAssistantFromTemplateAsync (client As AssistantClient, modelId As String, config As PromptTemplateConfig, Optional enableCodeInterpreter As Boolean = false, Optional codeInterpreterFileIds As IReadOnlyList(Of String) = Nothing, Optional enableFileSearch As Boolean = false, Optional vectorStoreId As String = Nothing, Optional temperature As Nullable(Of Single) = Nothing, Optional topP As Nullable(Of Single) = Nothing, Optional responseFormat As AssistantResponseFormat = Nothing, Optional metadata As IReadOnlyDictionary(Of String, String) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Assistant)

Parameters

client
OpenAI.Assistants.AssistantClient

The assistant client.

modelId
String

The model identifier.

config
PromptTemplateConfig

The prompt template configuration.

enableCodeInterpreter
Boolean

Whether to enable the code interpreter tool.

codeInterpreterFileIds
IReadOnlyList<String>

The file IDs for the code interpreter tool.

enableFileSearch
Boolean

Whether to enable the file search tool.

vectorStoreId
String

The vector store identifier.

temperature
Nullable<Single>

The temperature setting for the assistant.

topP
Nullable<Single>

The nucleus sampling factor for the assistant.

responseFormat
OpenAI.Assistants.AssistantResponseFormat

The response format for the assistant.

metadata
IReadOnlyDictionary<String,String>

The metadata for the assistant.

cancellationToken
CancellationToken

The cancellation token.

Returns

Task<OpenAI.Assistants.Assistant>

A task that represents the asynchronous operation. The task result contains the created assistant.

Applies to