Język

TaskDefinition<TInput,TOutput>.StartAsync Method

Definition

Starts the task and returns an awaitable handle once the creation round-trip succeeds.

public virtual System.Threading.Tasks.Task<Azure.AI.AgentServer.Core.Tasks.TaskRun<TOutput>> StartAsync(TInput input, Azure.AI.AgentServer.Core.Tasks.RunOptions? options = default, System.Threading.CancellationToken cancellationToken = default);
abstract member StartAsync : 'Input * Azure.AI.AgentServer.Core.Tasks.RunOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.AI.AgentServer.Core.Tasks.TaskRun<'Output>>
override this.StartAsync : 'Input * Azure.AI.AgentServer.Core.Tasks.RunOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.AI.AgentServer.Core.Tasks.TaskRun<'Output>>
Public Overridable Function StartAsync (input As TInput, Optional options As RunOptions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of TaskRun(Of TOutput))

Parameters

input
TInput

The typed input.

options
RunOptions

Optional per-invocation options.

cancellationToken
CancellationToken

A cancellation token.

Returns

Task<TaskRun<TOutput>>

An awaitable TaskRun<TOutput> handle.

Remarks

Concurrent starts for the same task id within one task engine coordinate initial creation. Once started, a steerable multi-turn task queues each accepted input with its own handle; a one-shot task converges on the existing run. Creation conflicts with another task engine are not automatically converted into steering. If a multi-turn execution suspends before accepting an input that was waiting to append, the start is re-evaluated with the same input id, precondition, and cancellation token.

Applies to