pub struct ModelRouter<C, S, A> { /* private fields */ }Implementations§
Source§impl<C, S, A> ModelRouter<C, S, A>
impl<C, S, A> ModelRouter<C, S, A>
pub const fn new(classifier: C, fast: S, capable: S, advanced: A) -> Self
Sourcepub async fn classify(&self, request: &ChatRequest) -> Result<TaskComplexity>
pub async fn classify(&self, request: &ChatRequest) -> Result<TaskComplexity>
§Errors
Returns an error if the LLM provider fails.
Sourcepub async fn route(&self, request: ChatRequest) -> Result<ChatOutcome>
pub async fn route(&self, request: ChatRequest) -> Result<ChatOutcome>
§Errors
Returns an error if the LLM provider fails.
Sourcepub async fn route_with_tier(
&self,
request: ChatRequest,
tier: ModelTier,
) -> Result<ChatOutcome>
pub async fn route_with_tier( &self, request: ChatRequest, tier: ModelTier, ) -> Result<ChatOutcome>
§Errors
Returns an error if the LLM provider fails.
pub const fn fast_provider(&self) -> &S
pub const fn capable_provider(&self) -> &S
pub const fn advanced_provider(&self) -> &A
Auto Trait Implementations§
impl<C, S, A> Freeze for ModelRouter<C, S, A>
impl<C, S, A> RefUnwindSafe for ModelRouter<C, S, A>
impl<C, S, A> Send for ModelRouter<C, S, A>
impl<C, S, A> Sync for ModelRouter<C, S, A>
impl<C, S, A> Unpin for ModelRouter<C, S, A>
impl<C, S, A> UnwindSafe for ModelRouter<C, S, A>
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