Share via


OpenAIAssistantAgent.InvokeAsync Method

Definition

Overloads

InvokeAsync(String, KernelArguments, Kernel, CancellationToken)

Invoke the assistant on the specified thread.

InvokeAsync(String, OpenAIAssistantInvocationOptions, KernelArguments, Kernel, CancellationToken)

Invoke the assistant on the specified thread.

InvokeAsync(String, KernelArguments, Kernel, CancellationToken)

Invoke the assistant on the specified thread.

public System.Collections.Generic.IAsyncEnumerable<Microsoft.SemanticKernel.ChatMessageContent> InvokeAsync (string threadId, Microsoft.SemanticKernel.KernelArguments? arguments = default, Microsoft.SemanticKernel.Kernel? kernel = default, System.Threading.CancellationToken cancellationToken = default);
member this.InvokeAsync : string * Microsoft.SemanticKernel.KernelArguments * Microsoft.SemanticKernel.Kernel * System.Threading.CancellationToken -> System.Collections.Generic.IAsyncEnumerable<Microsoft.SemanticKernel.ChatMessageContent>
Public Function InvokeAsync (threadId As String, Optional arguments As KernelArguments = Nothing, Optional kernel As Kernel = Nothing, Optional cancellationToken As CancellationToken = Nothing) As IAsyncEnumerable(Of ChatMessageContent)

Parameters

threadId
String

The thread identifier

arguments
KernelArguments

Optional arguments to pass to the agents's invocation, including any PromptExecutionSettings.

kernel
Kernel

The Kernel containing services, plugins, and other state for use by the agent.

cancellationToken
CancellationToken

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

Returns

Asynchronous enumeration of messages.

Remarks

The arguments parameter is not currently used by the agent, but is provided for future extensibility.

Applies to

InvokeAsync(String, OpenAIAssistantInvocationOptions, KernelArguments, Kernel, CancellationToken)

Invoke the assistant on the specified thread.

public System.Collections.Generic.IAsyncEnumerable<Microsoft.SemanticKernel.ChatMessageContent> InvokeAsync (string threadId, Microsoft.SemanticKernel.Agents.OpenAI.OpenAIAssistantInvocationOptions? options, Microsoft.SemanticKernel.KernelArguments? arguments = default, Microsoft.SemanticKernel.Kernel? kernel = default, System.Threading.CancellationToken cancellationToken = default);
member this.InvokeAsync : string * Microsoft.SemanticKernel.Agents.OpenAI.OpenAIAssistantInvocationOptions * Microsoft.SemanticKernel.KernelArguments * Microsoft.SemanticKernel.Kernel * System.Threading.CancellationToken -> System.Collections.Generic.IAsyncEnumerable<Microsoft.SemanticKernel.ChatMessageContent>
Public Function InvokeAsync (threadId As String, options As OpenAIAssistantInvocationOptions, Optional arguments As KernelArguments = Nothing, Optional kernel As Kernel = Nothing, Optional cancellationToken As CancellationToken = Nothing) As IAsyncEnumerable(Of ChatMessageContent)

Parameters

threadId
String

The thread identifier

options
OpenAIAssistantInvocationOptions

Optional invocation options

arguments
KernelArguments

Optional arguments to pass to the agents's invocation, including any PromptExecutionSettings.

kernel
Kernel

The Kernel containing services, plugins, and other state for use by the agent.

cancellationToken
CancellationToken

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

Returns

Asynchronous enumeration of messages.

Remarks

The arguments parameter is not currently used by the agent, but is provided for future extensibility.

Applies to