AiProviderConfig
struct · ferroui-protranslate-studio · v0.5.0
struct AiProviderConfig
Serializable host configuration. Debug output redacts the API key.
Members
providerapi_keymodel_idbase_urlis_enabledmax_tokenstemperatureomit_temperaturelegacy_max_tokensfor_provideris_configuredvalidate
provider
provider: AiProvider
api_key
api_key: String
model_id
model_id: String
Explicit model selection from live discovery or a host-supplied compatible ID. Empty configurations can discover models but cannot translate.
base_url
base_url: String
is_enabled
is_enabled: bool
max_tokens
max_tokens: u32
temperature
temperature: f64
omit_temperature
omit_temperature: bool
Omit the temperature field for models which do not accept sampling parameters. Enabled by default; opt into sampling only for a model that supports it.
legacy_max_tokens
legacy_max_tokens: bool
Use max_tokens for older OpenAI-compatible servers; otherwise max_completion_tokens.
for_provider
fn for_provider(provider: AiProvider) -> Self
is_configured
fn is_configured(self: &Self) -> bool
validate
fn validate(self: &Self) -> Result<(), StudioError>
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeBorrow<T>BorrowMut<T>CloneToUninitInto<U>From<T>TryInto<U>TryFrom<U>AnyToOwnedDeserializeOwnedErasedDestructorIntoEitherCloneStructuralPartialEqPartialEqSerializeDebugDefaultDeserialize<'de>
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.