IAgentExtensions.InvokeAsync 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.
Invoke agent with user input
public static System.Collections.Generic.IAsyncEnumerable<Microsoft.SemanticKernel.Experimental.Agents.IChatMessage> InvokeAsync (this Microsoft.SemanticKernel.Experimental.Agents.IAgent agent, string input, Microsoft.SemanticKernel.KernelArguments? arguments = default, System.Collections.Generic.IEnumerable<string>? fileIds = default, System.Threading.CancellationToken cancellationToken = default);
static member InvokeAsync : Microsoft.SemanticKernel.Experimental.Agents.IAgent * string * Microsoft.SemanticKernel.KernelArguments * seq<string> * System.Threading.CancellationToken -> System.Collections.Generic.IAsyncEnumerable<Microsoft.SemanticKernel.Experimental.Agents.IChatMessage>
<Extension()>
Public Function InvokeAsync (agent As IAgent, input As String, Optional arguments As KernelArguments = Nothing, Optional fileIds As IEnumerable(Of String) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As IAsyncEnumerable(Of IChatMessage)
Parameters
- agent
- IAgent
the agent
- input
- String
the user input
- arguments
- KernelArguments
Optional arguments for parameterized instructions
- fileIds
- IEnumerable<String>
an array of up to 10 file ids to reference for the message
- cancellationToken
- CancellationToken
Optional cancellation token
Returns
Chat messages