Table of Contents

Method Execute

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

Execute(Agent, string, CancellationToken)

Executes a task synchronously with the specified agent.

public AgentExecutionResult Execute(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

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.

ObjectDisposedException

Thrown when this executor has been disposed.

Execute(Agent, string, AgentExecutionOptions, CancellationToken)

Executes a task synchronously with the specified agent and options.

public AgentExecutionResult Execute(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

AgentExecutionResult

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