ChatOptions
Options & Configuration · AiDotNet.Agentic.Models
Per-request settings for a chat call: sampling controls, tool availability, and output format.
For Beginners
Think of this as the knobs on the request. Leave a knob untouched
(null) and a reasonable default is used. Turn it to change behavior:
Temperature: higher = more creative/random, lower = more focused.MaxOutputTokens: cap on reply length.Tools/ToolChoice: which tools the model may call, and how eagerly.ResponseFormat: ask for plain text or machine-readable JSON.
How It Works
Every property is nullable. null means “use the provider’s (or AiDotNet’s) sensible default”
rather than forcing callers to specify everything. This follows the library-wide options pattern:
zero-config by default, fully overridable when needed. Connectors apply documented defaults when a
value is null (for example, temperature ≈ 0.7).
Constructors
| Constructor | Summary |
|---|---|
ChatOptions() |
Properties
| Property | Summary |
|---|---|
ChatResponseFormatKind? ResponseFormat { get; set; } |
Gets or sets the desired output format. |
IReadOnlyList<AiToolDefinition> Tools { get; set; } |
Gets or sets the tools the model is allowed to call this turn. |
IReadOnlyList<string> StopSequences { get; set; } |
Gets or sets sequences that, when generated, cause the model to stop. |
JObject ResponseJsonSchema { get; set; } |
Gets or sets the JSON schema enforced when ResponseFormat is JsonSchema. |
ToolChoiceMode? ToolChoice { get; set; } |
Gets or sets how the model may use the supplied Tools. |
double? Temperature { get; set; } |
Gets or sets the sampling temperature (typically 0.0–2.0). |
double? TopP { get; set; } |
Gets or sets nucleus-sampling probability mass (0.0–1.0). |
int? MaxOutputTokens { get; set; } |
Gets or sets the maximum number of tokens to generate. |
int? Seed { get; set; } |
Gets or sets a deterministic sampling seed where the provider supports it. |
int? TopK { get; set; } |
Gets or sets top-K sampling. |
string RequiredToolName { get; set; } |
Gets or sets the specific tool the model must call. |