AssistantClientExtensions.CreateThreadAsync 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.
Creates a thread asynchronously with the specified options.
public static System.Threading.Tasks.Task<string> CreateThreadAsync(this OpenAI.Assistants.AssistantClient client, System.Collections.Generic.IEnumerable<Microsoft.SemanticKernel.ChatMessageContent>? messages = default, System.Collections.Generic.IReadOnlyList<string>? codeInterpreterFileIds = default, string? vectorStoreId = default, System.Collections.Generic.IReadOnlyDictionary<string,string>? metadata = default, System.Threading.CancellationToken cancellationToken = default);
static member CreateThreadAsync : OpenAI.Assistants.AssistantClient * seq<Microsoft.SemanticKernel.ChatMessageContent> * System.Collections.Generic.IReadOnlyList<string> * string * System.Collections.Generic.IReadOnlyDictionary<string, string> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<string>
<Extension()>
Public Function CreateThreadAsync (client As AssistantClient, Optional messages As IEnumerable(Of ChatMessageContent) = Nothing, Optional codeInterpreterFileIds As IReadOnlyList(Of String) = Nothing, Optional vectorStoreId As String = Nothing, Optional metadata As IReadOnlyDictionary(Of String, String) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of String)
Parameters
- client
- OpenAI.Assistants.AssistantClient
The assistant client.
- messages
- IEnumerable<ChatMessageContent>
The initial messages for the thread.
- codeInterpreterFileIds
- IReadOnlyList<String>
The file IDs for the code interpreter tool.
- vectorStoreId
- String
The vector store identifier.
- metadata
- IReadOnlyDictionary<String,String>
The metadata for the thread.
- cancellationToken
- CancellationToken
The cancellation token.
Returns
A task that represents the asynchronous operation. The task result contains the thread ID.