Table of Contents

Method ExecuteAsync

Namespace
LMKit.Agents
Assembly
LM-Kit.NET.dll

ExecuteAsync(Agent, string, CancellationToken)

Executes a task asynchronously with the specified agent.

public Task<AgentExecutionResult> ExecuteAsync(Agent agent, string input, CancellationToken cancellationToken = default)

Parameters

agent Agent

The agent to execute.

input string

The user input or task prompt.

cancellationToken CancellationToken

A token to cancel the operation.

Returns

Task<AgentExecutionResult>

A task that resolves to the execution result.

Exceptions

ArgumentNullException

Thrown when agent or input is null.

InvalidOperationException

Thrown when the agent is not properly configured.

ObjectDisposedException

Thrown when this executor has been disposed.

ExecuteAsync(Agent, string, AgentExecutionOptions, CancellationToken)

Executes a task asynchronously with the specified agent and options.

public Task<AgentExecutionResult> ExecuteAsync(Agent agent, string input, AgentExecutionOptions options, CancellationToken cancellationToken = default)

Parameters

agent Agent

The agent to execute.

input string

The user input or task prompt.

options AgentExecutionOptions

Execution options, or null to use defaults.

cancellationToken CancellationToken

A token to cancel the operation.

Returns

Task<AgentExecutionResult>

A task that resolves to the execution result.

Exceptions

ArgumentNullException

Thrown when agent or input is null.

InvalidOperationException

Thrown when the agent is not properly configured.

ObjectDisposedException

Thrown when this executor has been disposed.