pub struct OpenAiCompatibleModelClient { /* private fields */ }Implementations§
Source§impl OpenAiCompatibleModelClient
impl OpenAiCompatibleModelClient
pub fn new(config: OpenAiCompatibleConfig) -> Self
Trait Implementations§
Source§impl Clone for OpenAiCompatibleModelClient
impl Clone for OpenAiCompatibleModelClient
Source§fn clone(&self) -> OpenAiCompatibleModelClient
fn clone(&self) -> OpenAiCompatibleModelClient
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 Debug for OpenAiCompatibleModelClient
impl Debug for OpenAiCompatibleModelClient
Source§impl ModelClient for OpenAiCompatibleModelClient
impl ModelClient for OpenAiCompatibleModelClient
Source§fn stream<'life0, 'async_trait>(
&'life0 self,
input: ModelTurnInput,
) -> Pin<Box<dyn Future<Output = Result<BoxStream<'static, Result<ModelChunk, ModelClientError>>, ModelClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn stream<'life0, 'async_trait>(
&'life0 self,
input: ModelTurnInput,
) -> Pin<Box<dyn Future<Output = Result<BoxStream<'static, Result<ModelChunk, ModelClientError>>, ModelClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Stream the model’s response as a sequence of
ModelChunks. Production
ScriptedModelClient / OpenAiCompatibleModelClient implement this;
next() is provided as a folding convenience for callers that don’t
need token-level events.Source§fn next<'life0, 'async_trait>(
&'life0 self,
input: ModelTurnInput,
) -> Pin<Box<dyn Future<Output = Result<ModelResponse, ModelClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn next<'life0, 'async_trait>(
&'life0 self,
input: ModelTurnInput,
) -> Pin<Box<dyn Future<Output = Result<ModelResponse, ModelClientError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Buffer the stream into a single
ModelResponse. Default impl
awaits every chunk and then runs collect_model_response. Override
only if a provider has a cheaper non-streaming path (none today —
even OpenAI’s non-stream call still goes through the same SSE-or-not
branch on our side).Auto Trait Implementations§
impl !RefUnwindSafe for OpenAiCompatibleModelClient
impl !UnwindSafe for OpenAiCompatibleModelClient
impl Freeze for OpenAiCompatibleModelClient
impl Send for OpenAiCompatibleModelClient
impl Sync for OpenAiCompatibleModelClient
impl Unpin for OpenAiCompatibleModelClient
impl UnsafeUnpin for OpenAiCompatibleModelClient
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