pub struct ChainCallOptions {
pub max_tokens: Option<u32>,
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<u32>
§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: u32) -> 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 Freeze for ChainCallOptions
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
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>
Converts
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>
Converts
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