pub struct GLMProvider;Expand description
GLM (Zhipu AI) provider.
GLM has some specific requirements:
- Does not support function calling tools
- Messages should be flattened to simple text format
- API path is /chat/completions (not /v1/chat/completions)
Implementations§
Source§impl GLMProvider
impl GLMProvider
Trait Implementations§
Source§impl Clone for GLMProvider
impl Clone for GLMProvider
Source§fn clone(&self) -> GLMProvider
fn clone(&self) -> GLMProvider
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 GLMProvider
impl Default for GLMProvider
Source§impl Provider for GLMProvider
impl Provider for GLMProvider
Source§fn chat_completions_path(&self) -> String
fn chat_completions_path(&self) -> String
Get the chat completions path for this provider.
Only returns the endpoint path, e.g., “/chat/completions”.
The version prefix (e.g., “/v1”) should come from the backend URL’s base_path.
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 clone_box(&self) -> Box<dyn Provider + Send + Sync>
fn clone_box(&self) -> Box<dyn Provider + Send + Sync>
Clone the provider as a boxed trait object.
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 GLMProvider
impl RefUnwindSafe for GLMProvider
impl Send for GLMProvider
impl Sync for GLMProvider
impl Unpin for GLMProvider
impl UnsafeUnpin for GLMProvider
impl UnwindSafe for GLMProvider
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