pub struct OpenAiConfig {
pub api_key: String,
pub model: String,
pub base_url: String,
pub max_tokens: Option<u32>,
pub temperature: Option<f64>,
pub top_p: Option<f64>,
pub stop: Option<Vec<String>>,
pub seed: Option<u64>,
}Fields§
§api_key: String§model: String§base_url: String§max_tokens: Option<u32>§temperature: Option<f64>§top_p: Option<f64>§stop: Option<Vec<String>>§seed: Option<u64>Implementations§
Source§impl OpenAiConfig
impl OpenAiConfig
pub fn new(api_key: impl Into<String>, model: impl Into<String>) -> Self
pub fn with_base_url(self, url: impl Into<String>) -> Self
pub fn with_max_tokens(self, max_tokens: u32) -> Self
pub fn with_temperature(self, temperature: f64) -> Self
pub fn with_top_p(self, top_p: f64) -> Self
pub fn with_stop(self, stop: Vec<String>) -> Self
pub fn with_seed(self, seed: u64) -> Self
Trait Implementations§
Source§impl Clone for OpenAiConfig
impl Clone for OpenAiConfig
Source§fn clone(&self) -> OpenAiConfig
fn clone(&self) -> OpenAiConfig
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 moreAuto Trait Implementations§
impl Freeze for OpenAiConfig
impl RefUnwindSafe for OpenAiConfig
impl Send for OpenAiConfig
impl Sync for OpenAiConfig
impl Unpin for OpenAiConfig
impl UnsafeUnpin for OpenAiConfig
impl UnwindSafe for OpenAiConfig
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