pub struct Model<P: Provider + 'static> { /* private fields */ }Expand description
A wcore-typed view over a crabllm_core::Provider.
Holds an Arc<P> so cloning is cheap. The 'static bound on P
flows from the streaming path.
Implementations§
Source§impl<P: Provider + 'static> Model<P>
impl<P: Provider + 'static> Model<P>
Sourcepub async fn send_ct(
&self,
request: ChatCompletionRequest,
) -> Result<ChatCompletionResponse>
pub async fn send_ct( &self, request: ChatCompletionRequest, ) -> Result<ChatCompletionResponse>
Send a non-streaming chat completion request.
Sourcepub fn stream_ct(
&self,
request: ChatCompletionRequest,
) -> impl Stream<Item = Result<ChatCompletionChunk>> + Send + 'static
pub fn stream_ct( &self, request: ChatCompletionRequest, ) -> impl Stream<Item = Result<ChatCompletionChunk>> + Send + 'static
Stream a chat completion response.
Trait Implementations§
Auto Trait Implementations§
impl<P> Freeze for Model<P>
impl<P> RefUnwindSafe for Model<P>where
P: RefUnwindSafe,
impl<P> Send for Model<P>
impl<P> Sync for Model<P>
impl<P> Unpin for Model<P>
impl<P> UnsafeUnpin for Model<P>
impl<P> UnwindSafe for Model<P>where
P: RefUnwindSafe,
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