pub struct ProviderConfig {Show 20 fields
pub endpoint: String,
pub api_key: Option<String>,
pub models: Vec<String>,
pub models_path: String,
pub chat_path: String,
pub images_path: Option<String>,
pub embeddings_path: Option<String>,
pub audio_path: Option<String>,
pub speech_path: Option<String>,
pub headers: HashMap<String, String>,
pub token_url: Option<String>,
pub cached_token: Option<CachedToken>,
pub auth_type: Option<String>,
pub vars: HashMap<String, String>,
pub chat_templates: Option<HashMap<String, TemplateConfig>>,
pub images_templates: Option<HashMap<String, TemplateConfig>>,
pub embeddings_templates: Option<HashMap<String, TemplateConfig>>,
pub models_templates: Option<HashMap<String, TemplateConfig>>,
pub audio_templates: Option<HashMap<String, TemplateConfig>>,
pub speech_templates: Option<HashMap<String, TemplateConfig>>,
}Fields§
§endpoint: String§api_key: Option<String>§models: Vec<String>§models_path: String§chat_path: String§images_path: Option<String>§embeddings_path: Option<String>§audio_path: Option<String>§speech_path: Option<String>§headers: HashMap<String, String>§token_url: Option<String>§cached_token: Option<CachedToken>§auth_type: Option<String>§vars: HashMap<String, String>§chat_templates: Option<HashMap<String, TemplateConfig>>§images_templates: Option<HashMap<String, TemplateConfig>>§embeddings_templates: Option<HashMap<String, TemplateConfig>>§models_templates: Option<HashMap<String, TemplateConfig>>§audio_templates: Option<HashMap<String, TemplateConfig>>§speech_templates: Option<HashMap<String, TemplateConfig>>Implementations§
Source§impl ProviderConfig
impl ProviderConfig
Sourcepub fn is_chat_path_full_url(&self) -> bool
pub fn is_chat_path_full_url(&self) -> bool
Check if the chat_path is a full URL (starts with https://)
Sourcepub fn get_models_url(&self) -> String
pub fn get_models_url(&self) -> String
Get the models endpoint URL
Sourcepub fn get_chat_url(&self, model_name: &str) -> String
pub fn get_chat_url(&self, model_name: &str) -> String
Get the chat completions URL, replacing {model_name} and template variables
Sourcepub fn get_images_url(&self, model_name: &str) -> String
pub fn get_images_url(&self, model_name: &str) -> String
Get the images generation URL, replacing {model_name} and template variables
Sourcepub fn get_speech_url(&self, model_name: &str) -> String
pub fn get_speech_url(&self, model_name: &str) -> String
Get the speech generation URL, replacing {model_name} and template variables
Sourcepub fn get_embeddings_url(&self, model_name: &str) -> String
pub fn get_embeddings_url(&self, model_name: &str) -> String
Get the embeddings URL, replacing {model_name} and template variables
Trait Implementations§
Source§impl Clone for ProviderConfig
impl Clone for ProviderConfig
Source§fn clone(&self) -> ProviderConfig
fn clone(&self) -> ProviderConfig
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 Debug for ProviderConfig
impl Debug for ProviderConfig
Source§impl<'de> Deserialize<'de> for ProviderConfig
impl<'de> Deserialize<'de> for ProviderConfig
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 ProviderConfig
impl RefUnwindSafe for ProviderConfig
impl Send for ProviderConfig
impl Sync for ProviderConfig
impl Unpin for ProviderConfig
impl UnwindSafe for ProviderConfig
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 moreCreates a shared type from an unshared type.