pub struct RouteLayer { /* private fields */ }
Implementations§
Source§impl RouteLayer
impl RouteLayer
pub async fn add_routes( &mut self, routers: &mut [Router], ) -> Result<(), RouteLayerError>
pub async fn delete_route<S: Into<String>>( &mut self, route_name: S, ) -> Result<(), RouteLayerError>
pub async fn get_routers(&self) -> Result<Vec<Router>, RouteLayerError>
Sourcepub async fn call<S: Into<String>>(
&self,
query: S,
) -> Result<Option<RouteChoise>, RouteLayerError>
pub async fn call<S: Into<String>>( &self, query: S, ) -> Result<Option<RouteChoise>, RouteLayerError>
Call the route layer with a query and return the best route choise If route has a tool description, it will also return the tool input
Sourcepub async fn call_embedding(
&self,
embedding: &[f64],
) -> Result<Option<RouteChoise>, RouteLayerError>
pub async fn call_embedding( &self, embedding: &[f64], ) -> Result<Option<RouteChoise>, RouteLayerError>
Call the route layer with a query and return the best route choise If route has a tool description, it will not return the tool input, this just returns the route
Auto Trait Implementations§
impl Freeze for RouteLayer
impl !RefUnwindSafe for RouteLayer
impl !Send for RouteLayer
impl !Sync for RouteLayer
impl Unpin for RouteLayer
impl !UnwindSafe for RouteLayer
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> 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 more