pub struct LlmProfile {
pub provider: LlmProvider,
pub api_key: String,
pub model_name: String,
pub temperature: Option<f32>,
pub max_tokens: Option<usize>,
pub api_url: String,
}
Fields§
§provider: LlmProvider
§api_key: String
§model_name: String
§temperature: Option<f32>
§max_tokens: Option<usize>
§api_url: String
Implementations§
Source§impl LlmProfile
impl LlmProfile
pub fn send_single(&self, message: &str) -> Result<String, Error>
pub fn send_ollama(&self, message: &str) -> Result<String, Error>
pub fn extract_json<T: DeserializeOwned>( &self, input: &str, is_object: bool, ) -> Option<T>
pub fn extract_json_flexible<T: DeserializeOwned>( &self, input: &str, ) -> Option<T>
pub fn from_str( provider_slug: &str, model_name: &str, api_key: &str, temperature: Option<f32>, max_tokens: Option<usize>, ) -> Self
Trait Implementations§
Source§impl Clone for LlmProfile
impl Clone for LlmProfile
Source§fn clone(&self) -> LlmProfile
fn clone(&self) -> LlmProfile
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 moreSource§impl Default for LlmProfile
impl Default for LlmProfile
Source§fn default() -> LlmProfile
fn default() -> LlmProfile
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for LlmProfile
impl<'de> Deserialize<'de> for LlmProfile
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
Auto Trait Implementations§
impl Freeze for LlmProfile
impl RefUnwindSafe for LlmProfile
impl Send for LlmProfile
impl Sync for LlmProfile
impl Unpin for LlmProfile
impl UnwindSafe for LlmProfile
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