pub struct SharedModel { /* private fields */ }Expand description
Cloneable model handle used as the default for LanguageModelRequest.
Implements AISDK capability markers so the typed builder accepts prompts/tools
(runtime model selection — same idea as aisdk DynamicModel).
Implementations§
Sourcepub fn wrap<M: LanguageModel>(model: M) -> Self
pub fn wrap<M: LanguageModel>(model: M) -> Self
Wrap any AISDK LanguageModel (provider or crate::FakeAi).
Trait Implementations§
Source§fn clone(&self) -> SharedModel
fn clone(&self) -> SharedModel
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§fn generate_text<'life0, 'async_trait>(
&'life0 mut self,
options: LanguageModelOptions,
) -> Pin<Box<dyn Future<Output = AisdkResult<LanguageModelResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn generate_text<'life0, 'async_trait>(
&'life0 mut self,
options: LanguageModelOptions,
) -> Pin<Box<dyn Future<Output = AisdkResult<LanguageModelResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Performs a single, non-streaming text generation request. Read more
Source§fn stream_text<'life0, 'async_trait>(
&'life0 mut self,
options: LanguageModelOptions,
) -> Pin<Box<dyn Future<Output = AisdkResult<Pin<Box<dyn Stream<Item = Result<Vec<LanguageModelStreamChunk>>> + Send>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn stream_text<'life0, 'async_trait>(
&'life0 mut self,
options: LanguageModelOptions,
) -> Pin<Box<dyn Future<Output = AisdkResult<Pin<Box<dyn Stream<Item = Result<Vec<LanguageModelStreamChunk>>> + Send>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Performs a streaming text generation request. Read more
Auto Trait Implementations§
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