pub struct Options {
pub kind: ApiKind,
pub base_url: Option<String>,
pub env_var: Option<String>,
pub proxy: Option<String>,
pub model: String,
pub max_tokens: Option<i32>,
pub temperature: Option<f32>,
}Expand description
The AI options
Fields§
§kind: ApiKind§base_url: Option<String>§env_var: Option<String>§proxy: Option<String>§model: String§max_tokens: Option<i32>§temperature: Option<f32>Implementations§
Source§impl Options
impl Options
pub fn new(kind: ApiKind) -> Self
pub fn openai() -> Self
pub fn kind(self, kind: ApiKind) -> Self
pub fn base_url(self, url: impl Into<String>) -> Self
pub fn env_var(self, var: impl Into<String>) -> Self
pub fn proxy(self, proxy: impl Into<String>) -> Self
pub fn model(self, model: impl Into<String>) -> Self
pub fn max_tokens(self, tokens: i32) -> Self
pub fn temperature(self, temp: f32) -> Self
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Options
impl<'de> Deserialize<'de> for Options
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl TryFrom<Options> for Completions
impl TryFrom<Options> for Completions
Auto Trait Implementations§
impl Freeze for Options
impl RefUnwindSafe for Options
impl Send for Options
impl Sync for Options
impl Unpin for Options
impl UnsafeUnpin for Options
impl UnwindSafe for Options
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