Struct langchain_rust::chain::options::ChainCallOptions
source · pub struct ChainCallOptions {
pub max_tokens: Option<u16>,
pub temperature: Option<f32>,
pub stop_words: Option<Vec<String>>,
pub streaming_func: Option<Box<dyn FnMut(String) -> Pin<Box<dyn Future<Output = Result<(), ()>> + Send>> + Send>>,
pub top_k: Option<usize>,
pub top_p: Option<f32>,
pub seed: Option<usize>,
pub min_length: Option<usize>,
pub max_length: Option<usize>,
pub repetition_penalty: Option<f32>,
}
Fields§
§max_tokens: Option<u16>
§temperature: Option<f32>
§stop_words: Option<Vec<String>>
§streaming_func: Option<Box<dyn FnMut(String) -> Pin<Box<dyn Future<Output = Result<(), ()>> + Send>> + Send>>
§top_k: Option<usize>
§top_p: Option<f32>
§seed: Option<usize>
§min_length: Option<usize>
§max_length: Option<usize>
§repetition_penalty: Option<f32>
Implementations§
source§impl ChainCallOptions
impl ChainCallOptions
pub fn new() -> Self
pub fn to_llm_options(options: ChainCallOptions) -> CallOptions
pub fn with_max_tokens(self, max_tokens: u16) -> Self
pub fn with_temperature(self, temperature: f32) -> Self
pub fn with_stop_words(self, stop_words: Vec<String>) -> Self
pub fn with_streaming_func<F, Fut>(self, func: F) -> Self
pub fn with_top_k(self, top_k: usize) -> Self
pub fn with_top_p(self, top_p: f32) -> Self
pub fn with_seed(self, seed: usize) -> Self
pub fn with_min_length(self, min_length: usize) -> Self
pub fn with_max_length(self, max_length: usize) -> Self
pub fn with_repetition_penalty(self, repetition_penalty: f32) -> Self
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for ChainCallOptions
impl Send for ChainCallOptions
impl !Sync for ChainCallOptions
impl Unpin for ChainCallOptions
impl !UnwindSafe for ChainCallOptions
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