pub struct BaseModelConfig {
pub model_id: Option<String>,
pub max_tokens: Option<u64>,
pub temperature: Option<f64>,
pub top_p: Option<f64>,
pub context_window_limit: Option<u64>,
pub model_info: Option<ModelInfo>,
}Expand description
Configuration every model provider supports (BaseModelConfig).
Providers have their own typed configuration as well; this is the common view returned by
Model::get_config.
Fields§
§model_id: Option<String>The model identifier in the provider’s catalog.
max_tokens: Option<u64>Maximum number of tokens to generate in the response.
temperature: Option<f64>Controls randomness in generation.
top_p: Option<f64>Controls diversity via nucleus sampling.
context_window_limit: Option<u64>Context window size in tokens. The same fact as model_info.limits.context_window: it wins
over the shared model info, and model_info wins over it. Vended providers fill it from the
shared model info when unset; Model::model_info is the resolved view to read.
model_info: Option<ModelInfo>Overrides for what the SDK knows about the model. Fields set here win over the shared model info and the provider. An update that sets it replaces the previous override entirely.
Implementations§
Source§impl BaseModelConfig
impl BaseModelConfig
Sourcepub fn builder() -> BaseModelConfigBuilder
pub fn builder() -> BaseModelConfigBuilder
Create an instance of BaseModelConfig using the builder syntax
Source§impl BaseModelConfig
impl BaseModelConfig
Sourcepub fn merge(&mut self, update: Self)
pub fn merge(&mut self, update: Self)
Shallow-merges update into self: every field update sets replaces the current value.
Providers implement Model::update_config with it.
Trait Implementations§
Source§impl Clone for BaseModelConfig
impl Clone for BaseModelConfig
Source§impl Debug for BaseModelConfig
impl Debug for BaseModelConfig
Source§impl Default for BaseModelConfig
impl Default for BaseModelConfig
Source§impl From<BaseModelConfig> for AnthropicModelConfig
impl From<BaseModelConfig> for AnthropicModelConfig
Source§fn from(config: BaseModelConfig) -> Self
fn from(config: BaseModelConfig) -> Self
Source§impl From<BaseModelConfig> for BedrockModelConfig
impl From<BaseModelConfig> for BedrockModelConfig
Source§fn from(base: BaseModelConfig) -> Self
fn from(base: BaseModelConfig) -> Self
Source§impl From<BaseModelConfig> for OpenAIModelConfig
impl From<BaseModelConfig> for OpenAIModelConfig
Source§fn from(config: BaseModelConfig) -> Self
fn from(config: BaseModelConfig) -> Self
Source§impl PartialEq for BaseModelConfig
impl PartialEq for BaseModelConfig
impl StructuralPartialEq for BaseModelConfig
Auto Trait Implementations§
impl Freeze for BaseModelConfig
impl RefUnwindSafe for BaseModelConfig
impl Send for BaseModelConfig
impl Sync for BaseModelConfig
impl Unpin for BaseModelConfig
impl UnsafeUnpin for BaseModelConfig
impl UnwindSafe for BaseModelConfig
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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