Method ExecuteStreamingAsync
ExecuteStreamingAsync(Agent, string, IAgentStreamHandler, AgentExecutionOptions, CancellationToken)
Executes an agent with streaming output to a handler.
public Task<AgentExecutionResult> ExecuteStreamingAsync(Agent agent, string input, IAgentStreamHandler handler, AgentExecutionOptions options = null, CancellationToken cancellationToken = default)
Parameters
agentAgentThe agent to execute.
inputstringThe input prompt.
handlerIAgentStreamHandlerThe stream handler to receive tokens.
optionsAgentExecutionOptionsOptional execution options.
cancellationTokenCancellationTokenCancellation token.
Returns
- Task<AgentExecutionResult>
The final execution result.