pub struct ChatModelConfig {
pub base: LanguageModelConfig,
pub rate_limiter: Option<Arc<dyn BaseRateLimiter>>,
pub disable_streaming: DisableStreaming,
pub output_version: Option<String>,
pub profile: Option<ModelProfile>,
}Expand description
Configuration specific to chat models.
Fields§
§base: LanguageModelConfigBase language model configuration.
rate_limiter: Option<Arc<dyn BaseRateLimiter>>Rate limiter for limiting API requests.
disable_streaming: DisableStreamingWhether to disable streaming for this model.
If streaming is bypassed, then stream/astream will defer to invoke/ainvoke.
- If
Bool(true), will always bypass streaming case. - If
ToolCalling, will bypass streaming case only when tools are present. - If
Bool(false)(default), will always use streaming case if available.
output_version: Option<String>Version of AIMessage output format.
"v0": provider-specific format in content"v1": standardized format in content
Can also be set via LC_OUTPUT_VERSION environment variable.
profile: Option<ModelProfile>Profile detailing model capabilities.
Implementations§
Source§impl ChatModelConfig
impl ChatModelConfig
Sourcepub fn with_rate_limiter(self, rate_limiter: Arc<dyn BaseRateLimiter>) -> Self
pub fn with_rate_limiter(self, rate_limiter: Arc<dyn BaseRateLimiter>) -> Self
Set the rate limiter.
Sourcepub fn with_disable_streaming(
self,
disable: impl Into<DisableStreaming>,
) -> Self
pub fn with_disable_streaming( self, disable: impl Into<DisableStreaming>, ) -> Self
Set whether to disable streaming.
Sourcepub fn with_output_version(self, version: impl Into<String>) -> Self
pub fn with_output_version(self, version: impl Into<String>) -> Self
Set the output version.
Sourcepub fn with_profile(self, profile: ModelProfile) -> Self
pub fn with_profile(self, profile: ModelProfile) -> Self
Set the model profile.
Sourcepub fn with_cache(self, cache: bool) -> Self
pub fn with_cache(self, cache: bool) -> Self
Enable caching.
Sourcepub fn with_verbose(self, verbose: bool) -> Self
pub fn with_verbose(self, verbose: bool) -> Self
Enable verbose mode.
Set tags.
Sourcepub fn with_metadata(self, metadata: HashMap<String, Value>) -> Self
pub fn with_metadata(self, metadata: HashMap<String, Value>) -> Self
Set metadata.
Trait Implementations§
Source§impl Clone for ChatModelConfig
impl Clone for ChatModelConfig
Source§fn clone(&self) -> ChatModelConfig
fn clone(&self) -> ChatModelConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ChatModelConfig
impl Debug for ChatModelConfig
Source§impl Default for ChatModelConfig
impl Default for ChatModelConfig
Source§fn default() -> ChatModelConfig
fn default() -> ChatModelConfig
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ChatModelConfig
impl !RefUnwindSafe for ChatModelConfig
impl Send for ChatModelConfig
impl Sync for ChatModelConfig
impl Unpin for ChatModelConfig
impl !UnwindSafe for ChatModelConfig
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
Mutably borrows from an owned value. Read more