pub struct ModelPreset {Show 13 fields
pub id: String,
pub model: String,
pub display_name: String,
pub description: String,
pub default_reasoning_effort: ReasoningEffort,
pub supported_reasoning_efforts: Vec<ReasoningEffortPreset>,
pub supports_personality: bool,
pub is_default: bool,
pub upgrade: Option<ModelUpgrade>,
pub show_in_picker: bool,
pub availability_nux: Option<ModelAvailabilityNux>,
pub supported_in_api: bool,
pub input_modalities: Vec<InputModality>,
}Expand description
Metadata describing a Codex-supported model.
Fields§
§id: StringStable identifier for the preset.
model: StringModel slug (e.g., “gpt-5”).
display_name: StringDisplay name shown in UIs.
description: StringShort human description shown in UIs.
default_reasoning_effort: ReasoningEffortReasoning effort applied when none is explicitly chosen.
supported_reasoning_efforts: Vec<ReasoningEffortPreset>Supported reasoning effort options.
supports_personality: boolWhether this model supports personality-specific instructions.
is_default: boolWhether this is the default model for new users.
upgrade: Option<ModelUpgrade>recommended upgrade model
show_in_picker: boolWhether this preset should appear in the picker UI.
availability_nux: Option<ModelAvailabilityNux>Availability NUX shown when this preset becomes accessible to the user.
supported_in_api: boolwhether this model is supported in the api
input_modalities: Vec<InputModality>Input modalities accepted when composing user turns for this preset.
Implementations§
Source§impl ModelPreset
impl ModelPreset
Sourcepub fn filter_by_auth(
models: Vec<ModelPreset>,
chatgpt_mode: bool,
) -> Vec<ModelPreset>
pub fn filter_by_auth( models: Vec<ModelPreset>, chatgpt_mode: bool, ) -> Vec<ModelPreset>
Filter models based on authentication mode.
In ChatGPT mode, all models are visible. Otherwise, only API-supported models are shown.
Sourcepub fn mark_default_by_picker_visibility(models: &mut [ModelPreset])
pub fn mark_default_by_picker_visibility(models: &mut [ModelPreset])
Recompute the single default preset using picker visibility.
The first picker-visible model wins; if none are picker-visible, the first model wins.
Trait Implementations§
Source§impl Clone for ModelPreset
impl Clone for ModelPreset
Source§fn clone(&self) -> ModelPreset
fn clone(&self) -> ModelPreset
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ModelPreset
impl Debug for ModelPreset
Source§impl<'de> Deserialize<'de> for ModelPreset
impl<'de> Deserialize<'de> for ModelPreset
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl From<ModelInfo> for ModelPreset
impl From<ModelInfo> for ModelPreset
Source§impl JsonSchema for ModelPreset
impl JsonSchema for ModelPreset
Source§fn schema_name() -> String
fn schema_name() -> String
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref keyword. Read moreSource§impl PartialEq for ModelPreset
impl PartialEq for ModelPreset
Source§impl Serialize for ModelPreset
impl Serialize for ModelPreset
Source§impl TS for ModelPreset
impl TS for ModelPreset
Source§type WithoutGenerics = ModelPreset
type WithoutGenerics = ModelPreset
WithoutGenerics should just be Self.
If the type does have generic parameters, then all generic parameters must be replaced with
a dummy type, e.g ts_rs::Dummy or ().
The only requirement for these dummy types is that EXPORT_TO must be None. Read moreSource§type OptionInnerType = ModelPreset
type OptionInnerType = ModelPreset
std::option::Option<T>, then this associated type is set to T.
All other implementations of TS should set this type to Self instead.Source§fn docs() -> Option<String>
fn docs() -> Option<String>
TS is derived, docs are
automatically read from your doc comments or #[doc = ".."] attributesSource§fn decl_concrete() -> String
fn decl_concrete() -> String
TS::decl().
If this type is not generic, then this function is equivalent to TS::decl().Source§fn decl() -> String
fn decl() -> String
type User = { user_id: number, ... }.
This function will panic if the type has no declaration. Read moreSource§fn inline() -> String
fn inline() -> String
{ user_id: number }.
This function will panic if the type cannot be inlined.Source§fn inline_flattened() -> String
fn inline_flattened() -> String
This function will panic if the type cannot be flattened.
Source§fn visit_generics(v: &mut impl TypeVisitor)where
Self: 'static,
fn visit_generics(v: &mut impl TypeVisitor)where
Self: 'static,
Source§fn output_path() -> Option<PathBuf>
fn output_path() -> Option<PathBuf>
T should be exported.The returned path does not include the base directory from
TS_RS_EXPORT_DIR. Read moreSource§fn visit_dependencies(v: &mut impl TypeVisitor)where
Self: 'static,
fn visit_dependencies(v: &mut impl TypeVisitor)where
Self: 'static,
Source§fn dependencies() -> Vec<Dependency>where
Self: 'static,
fn dependencies() -> Vec<Dependency>where
Self: 'static,
Source§fn export() -> Result<(), ExportError>where
Self: 'static,
fn export() -> Result<(), ExportError>where
Self: 'static,
TS::export_all. Read moreSource§fn export_all() -> Result<(), ExportError>where
Self: 'static,
fn export_all() -> Result<(), ExportError>where
Self: 'static,
To export only this type, without its dependencies, use
TS::export. Read moreSource§fn export_all_to(out_dir: impl AsRef<Path>) -> Result<(), ExportError>where
Self: 'static,
fn export_all_to(out_dir: impl AsRef<Path>) -> Result<(), ExportError>where
Self: 'static,
To export only this type, without its dependencies, use
TS::export. Read moreSource§fn export_to_string() -> Result<String, ExportError>where
Self: 'static,
fn export_to_string() -> Result<String, ExportError>where
Self: 'static,
impl StructuralPartialEq for ModelPreset
Auto Trait Implementations§
impl Freeze for ModelPreset
impl RefUnwindSafe for ModelPreset
impl Send for ModelPreset
impl Sync for ModelPreset
impl Unpin for ModelPreset
impl UnsafeUnpin for ModelPreset
impl UnwindSafe for ModelPreset
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