ReasoningModelProfile
Models & Types · AiDotNet.Agentic.Models.Connectors
Describes one family of reasoning models: how to recognise it, and how its requests differ.
For Beginners
Newer “reasoning” models follow slightly different rules from ordinary chat models:
they refuse a couple of settings and spell one of them differently. A profile is a small rulebook for one family
of such models — “any model whose name starts with o3 behaves like this” — so the library can adjust your
request automatically instead of letting the provider reject it. You rarely create one yourself; the built-in
registry already covers the OpenAI families.
How It Works
Reasoning models are recognised by the start of their model id, not by the endpoint they are served from. That
is deliberate and matches the reference implementation: the same o3 weights are reachable through
OpenAI, Azure OpenAI, OpenRouter, and local proxies, and all of them enforce the same parameter rules, so a
check on the base URL would be wrong on three of the four. A profile therefore carries a list of model-id
prefixes and is matched case-insensitively against IChatClient<T>.ModelId.
The three behavioural differences a profile encodes are exactly the ones the provider enforces.
UnsupportedParameters lists the settings the model rejects outright — for the OpenAI families
temperature and top_p. UsesMaxCompletionTokens says the answer-length cap must be
sent as max_completion_tokens rather than max_tokens. SupportsReasoningEffort says a
deliberation level may be attached. SystemMessageRole exists for completeness and defaults to
system, because upstream applies no special handling to the system message for these models — it builds
the same {"role": "system"} entry for every model and branches only on the sampling parameters.
A profile is immutable and safe to share between clients and threads. Build custom ones for a provider whose naming differs from OpenAI’s, or to add a family the built-in registry does not yet know about, rather than patching a connector.
Constructors
| Constructor | Summary |
|---|---|
ReasoningModelProfile(string name, IReadOnlyList<string> modelIdPrefixes, bool usesMaxCompletionTokens, IReadOnlyList<ReasoningRequestParameter> unsupportedParameters, bool supportsReasoningEffort, ReasoningEffortLevel defaultReasoningEffort, string systemMessageRole) |
Initializes a reasoning-model profile. |
Properties
| Property | Summary |
|---|---|
IReadOnlyList<ReasoningRequestParameter> UnsupportedParameters { get; } |
Gets the settings this model family rejects. |
IReadOnlyList<string> ModelIdPrefixes { get; } |
Gets the model-id prefixes this profile claims. |
ReasoningEffortLevel DefaultReasoningEffort { get; } |
Gets the effort used when the caller configured none; Unspecified omits the field. |
bool SupportsReasoningEffort { get; } |
Gets whether a reasoning_effort field may be attached to the request. |
bool UsesMaxCompletionTokens { get; } |
Gets whether the answer-length cap is sent as max_completion_tokens. |
string Name { get; } |
Gets the short family name used in diagnostics. |
string SystemMessageRole { get; } |
Gets the role name system messages are sent under, system unless overridden. |
Methods
| Method | Summary |
|---|---|
bool Matches(string modelId) |
Reports whether this profile claims a model id. |
bool Rejects(ReasoningRequestParameter parameter) |
Reports whether this model family rejects a setting. |
string ToString() |
Returns the family name and the number of prefixes it claims. |
Fields
| Field | Summary |
|---|---|
string DefaultSystemMessageRole |
The wire value used when no system-message rewriting is requested. |