Documentation
Table of Contents

Method PlanAsync

Namespace
IntentSharp.Targets
Assembly
IntentSharp.dll

PlanAsync(string, object?, CancellationToken)

Senses the target and asks the model for a command for request, checking each reply on the way. Nothing is executed. When the check with data.stage sense refuses, no model is called and the result is unsuccessful with one Guardrail issue.

public Task<AIResult<CommandPlan>> PlanAsync(string request, object? input = null, CancellationToken cancellationToken = default)

Parameters

request string

What the caller wants, in plain language.

input object

A value the command works with, such as a record to write; null for none. It is sent to the model.

cancellationToken CancellationToken

Cancels the call.

Returns

Task<AIResult<CommandPlan>>

The planning result; its value is the plan, with the entities the target's inspection found.

Exceptions

ArgumentNullException

request is null.

ArgumentException

request is empty.

InvalidOperationException

The plan intent is neither in the client's document store nor shipped by the library.

TargetOperationException

Describing the target failed.