pub struct ParameterSupport {
pub temperature: ParameterRestriction,
pub frequency_penalty: ParameterRestriction,
pub presence_penalty: ParameterRestriction,
pub logprobs: bool,
pub top_logprobs: bool,
pub logit_bias: bool,
pub n_multiple: bool,
pub top_p: ParameterRestriction,
pub reasoning: bool,
}Expand description
Parameter support information for a model.
This struct provides detailed information about which parameters are supported by a model and any restrictions that apply.
§Example
use openai_tools::common::models::{ChatModel, ParameterRestriction};
let model = ChatModel::O3Mini;
let support = model.parameter_support();
// Reasoning models only support temperature = 1.0
assert_eq!(support.temperature, ParameterRestriction::FixedValue(1.0));
// Reasoning models don't support logprobs
assert!(!support.logprobs);Fields§
§temperature: ParameterRestrictionTemperature parameter restriction (Chat & Responses API)
frequency_penalty: ParameterRestrictionFrequency penalty parameter restriction (Chat API only)
presence_penalty: ParameterRestrictionPresence penalty parameter restriction (Chat API only)
logprobs: boolWhether logprobs parameter is supported (Chat API only)
top_logprobs: boolWhether top_logprobs parameter is supported (Chat & Responses API)
logit_bias: boolWhether logit_bias parameter is supported (Chat API only)
n_multiple: boolWhether n > 1 (multiple completions) is supported (Chat API only)
top_p: ParameterRestrictionTop P parameter restriction (Responses API only)
reasoning: boolWhether reasoning parameter is supported (Responses API only, reasoning models)
Implementations§
Source§impl ParameterSupport
impl ParameterSupport
Sourcepub fn standard_model() -> Self
pub fn standard_model() -> Self
Creates parameter support info for standard (non-reasoning) models.
Standard models support all parameters with full range.
Sourcepub fn reasoning_model() -> Self
pub fn reasoning_model() -> Self
Creates parameter support info for reasoning models (GPT-5, o-series).
Reasoning models have restricted parameter support:
- temperature: only 1.0
- top_p: only 1.0
- frequency_penalty: only 0
- presence_penalty: only 0
- logprobs, top_logprobs, logit_bias: not supported
- n: only 1
- reasoning: supported
Sourcepub fn search_model() -> Self
pub fn search_model() -> Self
Creates parameter support info for web-search models
(gpt-5-search-api, gpt-4o-search-preview, …).
These reject the whole sampling parameter set the same way reasoning
models do, but they expose no reasoning parameter - the API rejects
it with “Model incompatible request argument supplied”.
Trait Implementations§
Source§impl Clone for ParameterSupport
impl Clone for ParameterSupport
Source§fn clone(&self) -> ParameterSupport
fn clone(&self) -> ParameterSupport
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more