pub struct GroqConfig {
pub api_key: String,
pub model: String,
pub base_url: Option<String>,
pub reasoning_enabled: bool,
pub max_tokens: Option<u32>,
}Available on crate feature
models only.Expand description
Configuration for Groq API.
Fields§
§api_key: StringGroq API key.
model: StringModel name.
base_url: Option<String>Optional custom base URL.
reasoning_enabled: boolEnable reasoning mode (include_reasoning).
max_tokens: Option<u32>Maximum tokens for output.
Implementations§
Source§impl GroqConfig
impl GroqConfig
Sourcepub fn new(api_key: impl Into<String>, model: impl Into<String>) -> GroqConfig
Available on crate feature groq only.
pub fn new(api_key: impl Into<String>, model: impl Into<String>) -> GroqConfig
groq only.Create a new Groq config with the given API key and model.
Sourcepub fn llama70b(api_key: impl Into<String>) -> GroqConfig
Available on crate feature groq only.
pub fn llama70b(api_key: impl Into<String>) -> GroqConfig
groq only.Create a config for llama-3.3-70b-versatile model.
Sourcepub fn llama8b(api_key: impl Into<String>) -> GroqConfig
Available on crate feature groq only.
pub fn llama8b(api_key: impl Into<String>) -> GroqConfig
groq only.Create a config for llama-3.1-8b-instant model (faster, smaller).
Sourcepub fn mixtral(api_key: impl Into<String>) -> GroqConfig
Available on crate feature groq only.
pub fn mixtral(api_key: impl Into<String>) -> GroqConfig
groq only.Create a config for mixtral-8x7b-32768 model.
Sourcepub fn gemma(api_key: impl Into<String>) -> GroqConfig
Available on crate feature groq only.
pub fn gemma(api_key: impl Into<String>) -> GroqConfig
groq only.Create a config for gemma2-9b-it model.
Sourcepub fn with_reasoning(self, enabled: bool) -> GroqConfig
Available on crate feature groq only.
pub fn with_reasoning(self, enabled: bool) -> GroqConfig
groq only.Enable reasoning mode.
Sourcepub fn with_max_tokens(self, max_tokens: u32) -> GroqConfig
Available on crate feature groq only.
pub fn with_max_tokens(self, max_tokens: u32) -> GroqConfig
groq only.Set max tokens for output.
Sourcepub fn with_base_url(self, base_url: impl Into<String>) -> GroqConfig
Available on crate feature groq only.
pub fn with_base_url(self, base_url: impl Into<String>) -> GroqConfig
groq only.Set custom base URL.
Sourcepub fn effective_base_url(&self) -> &str
Available on crate feature groq only.
pub fn effective_base_url(&self) -> &str
groq only.Get the effective base URL.
Trait Implementations§
Source§impl Clone for GroqConfig
impl Clone for GroqConfig
Source§fn clone(&self) -> GroqConfig
fn clone(&self) -> GroqConfig
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 GroqConfig
impl Debug for GroqConfig
Source§impl Default for GroqConfig
impl Default for GroqConfig
Source§fn default() -> GroqConfig
fn default() -> GroqConfig
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for GroqConfig
impl<'de> Deserialize<'de> for GroqConfig
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<GroqConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<GroqConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for GroqConfig
impl Serialize for GroqConfig
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
Auto Trait Implementations§
impl Freeze for GroqConfig
impl RefUnwindSafe for GroqConfig
impl Send for GroqConfig
impl Sync for GroqConfig
impl Unpin for GroqConfig
impl UnwindSafe for GroqConfig
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> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request