pub struct DefaultProvider { /* private fields */ }Expand description
Default provider that makes minimal assumptions.
This provider assumes:
- Standard OpenAI-compatible API path:
/chat/completions(the/v1prefix comes from the backend URL’s base_path) - Model names are passed through as-is
- No special request/response transformations needed
Use this as a fallback for providers not explicitly supported.
The backend_name field preserves the backend name from the config
(e.g., "qwen", "yi") so that logging and diagnostics can identify
which backend a request was routed to, even though the provider
implementation is the generic default.
Implementations§
Trait Implementations§
Source§impl Default for DefaultProvider
impl Default for DefaultProvider
Source§impl Provider for DefaultProvider
impl Provider for DefaultProvider
Source§fn name(&self) -> &'static str
fn name(&self) -> &'static str
Returns "default" to indicate this is the generic fallback provider.
Source§fn display_name(&self) -> &str
fn display_name(&self) -> &str
Returns the original backend name from config (e.g., "qwen",
"yi-lightning"), making it easy to identify which backend a
request was routed to in logs and diagnostics.
Source§fn chat_completions_path(&self) -> String
fn chat_completions_path(&self) -> String
Get the chat completions path for this provider. Read more
Source§fn transform_request(&self, _request: &mut ChatRequest)
fn transform_request(&self, _request: &mut ChatRequest)
Transform request before sending to provider. Read more
Source§fn transform_response(&self, _response: &mut ChatResponse)
fn transform_response(&self, _response: &mut ChatResponse)
Transform response after receiving from provider. Read more
Source§fn transform_stream_chunk(&self, _chunk: &mut ChatStreamChunk)
fn transform_stream_chunk(&self, _chunk: &mut ChatStreamChunk)
Transform streaming chunk in real-time. Read more
Source§fn normalize_model(&self, model: String) -> String
fn normalize_model(&self, model: String) -> String
Normalize model name from Responses API to provider’s format.
Auto Trait Implementations§
impl Freeze for DefaultProvider
impl RefUnwindSafe for DefaultProvider
impl Send for DefaultProvider
impl Sync for DefaultProvider
impl Unpin for DefaultProvider
impl UnsafeUnpin for DefaultProvider
impl UnwindSafe for DefaultProvider
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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