pub struct CallOptions {Show 17 fields
pub candidate_count: Option<usize>,
pub max_tokens: Option<u32>,
pub temperature: Option<f32>,
pub stop_words: Option<Vec<String>>,
pub streaming_func: Option<Arc<Mutex<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 n: Option<usize>,
pub repetition_penalty: Option<f32>,
pub frequency_penalty: Option<f32>,
pub presence_penalty: Option<f32>,
pub functions: Option<Vec<FunctionDefinition>>,
pub function_call_behavior: Option<FunctionCallBehavior>,
pub stream_usage: Option<bool>,
}
Fields§
§candidate_count: Option<usize>
§max_tokens: Option<u32>
§temperature: Option<f32>
§stop_words: Option<Vec<String>>
§streaming_func: Option<Arc<Mutex<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>
§n: Option<usize>
§repetition_penalty: Option<f32>
§frequency_penalty: Option<f32>
§presence_penalty: Option<f32>
§functions: Option<Vec<FunctionDefinition>>
§function_call_behavior: Option<FunctionCallBehavior>
§stream_usage: Option<bool>
Implementations§
Source§impl CallOptions
impl CallOptions
pub fn new() -> Self
pub fn with_max_tokens(self, max_tokens: u32) -> Self
pub fn with_candidate_count(self, candidate_count: usize) -> 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_n(self, n: usize) -> Self
pub fn with_repetition_penalty(self, repetition_penalty: f32) -> Self
pub fn with_frequency_penalty(self, frequency_penalty: f32) -> Self
pub fn with_presence_penalty(self, presence_penalty: f32) -> Self
pub fn with_functions(self, functions: Vec<FunctionDefinition>) -> Self
pub fn with_function_call_behavior(self, behavior: FunctionCallBehavior) -> Self
pub fn with_stream_usage(self, stream_usage: bool) -> Self
pub fn merge_options(&mut self, incoming_options: CallOptions)
Trait Implementations§
Source§impl Clone for CallOptions
impl Clone for CallOptions
Source§fn clone(&self) -> CallOptions
fn clone(&self) -> CallOptions
Returns a copy 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 moreAuto Trait Implementations§
impl Freeze for CallOptions
impl !RefUnwindSafe for CallOptions
impl Send for CallOptions
impl Sync for CallOptions
impl Unpin for CallOptions
impl !UnwindSafe for CallOptions
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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