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
Trait Implementations§
Source§impl Clone for ParameterSupport
impl Clone for ParameterSupport
Source§fn clone(&self) -> ParameterSupport
fn clone(&self) -> ParameterSupport
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for ParameterSupport
impl RefUnwindSafe for ParameterSupport
impl Send for ParameterSupport
impl Sync for ParameterSupport
impl Unpin for ParameterSupport
impl UnwindSafe for ParameterSupport
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more