pub struct GroqAdapter { /* private fields */ }Expand description
Adapter for the Groq Chat Completions API.
Groq is OpenAI-compatible so requests pass through with minimal changes. The main value-add is rate limit header extraction.
Implementations§
Trait Implementations§
Source§impl Clone for GroqAdapter
impl Clone for GroqAdapter
Source§fn clone(&self) -> GroqAdapter
fn clone(&self) -> GroqAdapter
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 GroqAdapter
impl Debug for GroqAdapter
Source§impl Default for GroqAdapter
impl Default for GroqAdapter
Source§impl ProviderAdapter for GroqAdapter
impl ProviderAdapter for GroqAdapter
Source§fn provider_name(&self) -> &str
fn provider_name(&self) -> &str
Provider identifier (e.g., “openai”, “anthropic”).
Source§fn convert_request(&self, payload: Value) -> Value
fn convert_request(&self, payload: Value) -> Value
Convert an internal Chat Completions payload to provider-specific format. Read more
Source§fn convert_response(&self, response: Value) -> Value
fn convert_response(&self, response: Value) -> Value
Convert a provider-specific response back to Chat Completions format. Read more
Source§fn extra_headers(&self) -> Vec<(String, String)>
fn extra_headers(&self) -> Vec<(String, String)>
Get required headers for this provider (e.g., api-version, anthropic-version).
Source§fn supports_streaming(&self) -> bool
fn supports_streaming(&self) -> bool
Whether this adapter supports streaming responses.
Source§fn enable_streaming(&self, _payload: &mut Value)
fn enable_streaming(&self, _payload: &mut Value)
Add streaming parameters to the request payload. Read more
Source§fn streaming_url(&self, base_url: &str) -> Option<String>
fn streaming_url(&self, base_url: &str) -> Option<String>
Get the streaming API URL, if different from the regular API URL. Read more
Source§fn parse_stream_event(
&self,
_event_type: &str,
_data: &Value,
) -> Option<StreamEvent>
fn parse_stream_event( &self, _event_type: &str, _data: &Value, ) -> Option<StreamEvent>
Parse a single SSE event into a stream event. Read more
Auto Trait Implementations§
impl Freeze for GroqAdapter
impl RefUnwindSafe for GroqAdapter
impl Send for GroqAdapter
impl Sync for GroqAdapter
impl Unpin for GroqAdapter
impl UnsafeUnpin for GroqAdapter
impl UnwindSafe for GroqAdapter
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