Freigeben über


AssistantsClient.CreateRunAsync Method

Definition

Overloads

CreateRunAsync(AssistantThread, Assistant, CancellationToken)

Creates a new run of the specified thread using a specified assistant.

CreateRunAsync(String, CreateRunOptions, CancellationToken)

Creates a new run for an assistant thread.

CreateRunAsync(AssistantThread, Assistant, CancellationToken)

Source:
AssistantsClient.cs

Creates a new run of the specified thread using a specified assistant.

public virtual System.Threading.Tasks.Task<Azure.Response<Azure.AI.OpenAI.Assistants.ThreadRun>> CreateRunAsync (Azure.AI.OpenAI.Assistants.AssistantThread thread, Azure.AI.OpenAI.Assistants.Assistant assistant, System.Threading.CancellationToken cancellationToken = default);
abstract member CreateRunAsync : Azure.AI.OpenAI.Assistants.AssistantThread * Azure.AI.OpenAI.Assistants.Assistant * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.AI.OpenAI.Assistants.ThreadRun>>
override this.CreateRunAsync : Azure.AI.OpenAI.Assistants.AssistantThread * Azure.AI.OpenAI.Assistants.Assistant * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.AI.OpenAI.Assistants.ThreadRun>>
Public Overridable Function CreateRunAsync (thread As AssistantThread, assistant As Assistant, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of ThreadRun))

Parameters

thread
AssistantThread

The thread that should be run.

assistant
Assistant

The assistant that should run the thread.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

A new ThreadRun instance.

Remarks

This method will create the run with default configuration. To customize the run, use CreateRun(String, CreateRunOptions, CancellationToken).

Applies to

CreateRunAsync(String, CreateRunOptions, CancellationToken)

Source:
AssistantsClient.cs

Creates a new run for an assistant thread.

public virtual System.Threading.Tasks.Task<Azure.Response<Azure.AI.OpenAI.Assistants.ThreadRun>> CreateRunAsync (string threadId, Azure.AI.OpenAI.Assistants.CreateRunOptions createRunOptions, System.Threading.CancellationToken cancellationToken = default);
abstract member CreateRunAsync : string * Azure.AI.OpenAI.Assistants.CreateRunOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.AI.OpenAI.Assistants.ThreadRun>>
override this.CreateRunAsync : string * Azure.AI.OpenAI.Assistants.CreateRunOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response<Azure.AI.OpenAI.Assistants.ThreadRun>>
Public Overridable Function CreateRunAsync (threadId As String, createRunOptions As CreateRunOptions, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response(Of ThreadRun))

Parameters

threadId
String

The ID of the thread to run.

createRunOptions
CreateRunOptions

The details for the run to create.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Exceptions

threadId or createRunOptions is null.

threadId is an empty string, and was expected to be non-empty.

Applies to