Documentation
Table of Contents

Class AIRequestOptions

Namespace
IntentSharp
Assembly
IntentSharp.dll

Per-request overrides. Everything is optional; unset values come from IntentClientOptions. A value that is set must be in the same range as the client option (MaxAttempts, MaxOutputTokens and MaxModelCalls at least 1, Temperature 0 to 2, Timeout greater than zero and at most about 49.7 days, the longest a cancellation timer accepts), or TransformAsync<T>(object?, string, AIRequestOptions?, CancellationToken) throws ArgumentOutOfRangeException before any model call.

public sealed class AIRequestOptions
Inheritance
object
AIRequestOptions
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.ReferenceEquals(object, object)
object.ToString()
Extension Methods

Constructors

AIRequestOptions()

Creates options that override nothing: every setting comes from IntentClientOptions, and the validators, tags and examples start empty.

Properties

BypassCache

Opt this request out of the request cache.

DoNotRecord

Opt this request out of memory recording (for sensitive inputs).

Examples

Worked examples sent to the model with the request. Each example is an input rendered as text and the exact output expected for it. Examples steer format and judgement; they never replace the checks on the result.

ExpectedOutputDescription

Free-text description of the expected output, sent to the model with the request. Useful when the type alone is not enough ("ISO 8601 dates", "T-SQL dialect").

MaxAttempts

Attempts for this request. Null uses MaxAttempts.

MaxModelCalls

Ceiling on model calls for this request (attempts plus judge calls). Null uses MaxModelCalls.

MaxOutputTokens

Output token ceiling per model call for this request. Null uses MaxOutputTokens.

Model

Model override for this request.

OutputSchema

A JSON schema for the result when the shape is defined at run time rather than by a .NET type. Used by TransformAsync(object?, string, JsonNode, AIRequestOptions?, CancellationToken); ignored for other target types. A strict copy of this schema is sent to the provider as the shape of the result.

Provider

Provider override for this request, by Name.

SystemInstructions

Additional instructions sent to the model with the request.

Tags

Tags carried into logs and memory.

Temperature

Sampling temperature for this request. Null uses Temperature.

Timeout

Wall-clock budget for this request, every attempt included. Null uses DefaultTimeout. A request that runs out of time fails with a Guardrail issue rather than throwing.

UseJudge

Ask the judge to review this request's result (honoured when JudgeMode is OnRequest or Always).

Validators

Custom checks run on the parsed value. Return problems as strings; an empty sequence means the value is acceptable. Findings are fed back to the model on the next attempt.

Methods

Clone()

Returns a copy. Library helpers clone caller-supplied options before adding their own validators so the caller's instance is never mutated.

Require<T>(Func<T, bool>, string)

Adds a typed predicate validator with a single failure message.

Validate<T>(Func<T, IEnumerable<string>>)

Adds a typed validator.