MentorAgent Docs
Menu

ReferencePackage: Novior.MentorAgent.Abstractions

IMentorCommandHandler<TCommand, TResult>

The IMentorCommandHandler<TCommand, TResult> interface of Novior.MentorAgent.Abstractions.Interfaces: Handles a command that returns a result: a request that…

View as Markdown
On this page

Handles a command that returns a result: a request that changes data, written as a type of its own, whose result the model reads as an action's. Registered with MentorOptions.Actions.AddCommand<TCommand, THandler>(), as IMentorCommandHandler<TCommand>.

Namespace: Novior.MentorAgent.Abstractions.Interfaces. Package: Novior.MentorAgent.Abstractions.

public interface IMentorCommandHandler<TCommand, TResult>

Terminal
dotnet add package Novior.MentorAgent.Abstractions

Task<TResult?> HandleAsync(TCommand command, CancellationToken cancellationToken)

Runs command. An exception fails the action, and the model reads that it failed.

Parameters

  • command: The command, built from the model's arguments.
  • cancellationToken: Cancelled when the turn is.

Returns: The result the model reads.