Table of Contents

Method ExecuteAsync

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

ExecuteAsync(Agent, string, CancellationToken)

Executes a single task with the specified agent.

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>

The execution result containing the agent's response and metadata.

Exceptions

ArgumentNullException

Thrown when agent or input is null.

InvalidOperationException

Thrown when the agent is not properly configured (e.g., missing required model).