pub struct MultiLLMRouter { /* private fields */ }Implementations§
Source§impl MultiLLMRouter
impl MultiLLMRouter
pub fn new(primary: Arc<dyn LLMProvider>) -> MultiLLMRouter
pub fn with_tool_selector( self, provider: Arc<dyn LLMProvider>, ) -> MultiLLMRouter
pub fn with_guard_evaluator( self, provider: Arc<dyn LLMProvider>, ) -> MultiLLMRouter
pub fn with_classifier(self, provider: Arc<dyn LLMProvider>) -> MultiLLMRouter
pub fn with_fallback(self, enable: bool) -> MultiLLMRouter
Trait Implementations§
Source§impl Clone for MultiLLMRouter
impl Clone for MultiLLMRouter
Source§fn clone(&self) -> MultiLLMRouter
fn clone(&self) -> MultiLLMRouter
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 LLMCapability for MultiLLMRouter
impl LLMCapability for MultiLLMRouter
fn select_tool<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
context: &'life1 TaskContext,
user_input: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<ToolSelection, LLMError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
MultiLLMRouter: 'async_trait,
fn generate_tool_args<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
tool_id: &'life1 str,
user_input: &'life2 str,
schema: &'life3 Value,
) -> Pin<Box<dyn Future<Output = Result<Value, LLMError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
MultiLLMRouter: 'async_trait,
fn evaluate_yesno<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
question: &'life1 str,
context: &'life2 TaskContext,
) -> Pin<Box<dyn Future<Output = Result<(bool, String), LLMError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
MultiLLMRouter: 'async_trait,
fn classify<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
input: &'life1 str,
categories: &'life2 [String],
) -> Pin<Box<dyn Future<Output = Result<(String, f32), LLMError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
MultiLLMRouter: 'async_trait,
fn process_task<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
context: &'life1 TaskContext,
system_prompt: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<LLMResponse, LLMError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
MultiLLMRouter: 'async_trait,
Source§impl LLMProvider for MultiLLMRouter
impl LLMProvider for MultiLLMRouter
Source§fn complete<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
messages: &'life1 [ChatMessage],
config: Option<&'life2 LLMConfig>,
) -> Pin<Box<dyn Future<Output = Result<LLMResponse, LLMError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
MultiLLMRouter: 'async_trait,
fn complete<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
messages: &'life1 [ChatMessage],
config: Option<&'life2 LLMConfig>,
) -> Pin<Box<dyn Future<Output = Result<LLMResponse, LLMError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
MultiLLMRouter: 'async_trait,
Send messages and get a complete response.
Source§fn complete_stream<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
messages: &'life1 [ChatMessage],
config: Option<&'life2 LLMConfig>,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn Stream<Item = Result<LLMChunk, LLMError>> + Unpin + Send>, LLMError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
MultiLLMRouter: 'async_trait,
fn complete_stream<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
messages: &'life1 [ChatMessage],
config: Option<&'life2 LLMConfig>,
) -> Pin<Box<dyn Future<Output = Result<Box<dyn Stream<Item = Result<LLMChunk, LLMError>> + Unpin + Send>, LLMError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
MultiLLMRouter: 'async_trait,
Send messages and get a streaming response.
Source§fn provider_name(&self) -> &str
fn provider_name(&self) -> &str
Provider identifier (e.g.
"openai", "anthropic").Source§fn supports(&self, feature: LLMFeature) -> bool
fn supports(&self, feature: LLMFeature) -> bool
Check if this provider supports a given feature.
Auto Trait Implementations§
impl Freeze for MultiLLMRouter
impl !RefUnwindSafe for MultiLLMRouter
impl Send for MultiLLMRouter
impl Sync for MultiLLMRouter
impl Unpin for MultiLLMRouter
impl UnsafeUnpin for MultiLLMRouter
impl !UnwindSafe for MultiLLMRouter
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.