pub struct RemoteModel { /* private fields */ }Expand description
A ModelBackend that runs turns on the user’s other nodes, with fallback.
Implementations§
Source§impl RemoteModel
impl RemoteModel
Sourcepub fn with_model(self, model: impl Into<String>) -> Self
pub fn with_model(self, model: impl Into<String>) -> Self
Ask the nodes for this model id instead of their default.
Sourcepub fn with_fallback(self, fallback: Arc<dyn ModelBackend>) -> Self
pub fn with_fallback(self, fallback: Arc<dyn ModelBackend>) -> Self
Run here when no node can take the turn.
pub fn with_accept_timeout(self, timeout: Duration) -> Self
pub fn nodes(&self) -> &[String]
Sourcepub fn last_route(&self) -> Option<Route>
pub fn last_route(&self) -> Option<Route>
Where the last completed turn ran.
Trait Implementations§
Source§impl ModelBackend for RemoteModel
impl ModelBackend for RemoteModel
Source§fn name(&self) -> String
fn name(&self) -> String
The model and node of the last turn (traces record it after each turn).
fn complete<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
messages: &'life1 [Message],
tools: &'life2 [ToolSpec],
deltas: &'life3 DeltaSink,
cancel: &'life4 CancelToken,
) -> Pin<Box<dyn Future<Output = Result<ModelTurn, ModelError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Auto Trait Implementations§
impl !Freeze for RemoteModel
impl !RefUnwindSafe for RemoteModel
impl !UnwindSafe for RemoteModel
impl Forget for RemoteModel
impl Move for RemoteModel
impl Send for RemoteModel
impl Sync for RemoteModel
impl Unpin for RemoteModel
impl UnsafeUnpin for RemoteModel
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