pub struct RouterChainBuilder { /* private fields */ }Implementations§
Source§impl RouterChainBuilder
impl RouterChainBuilder
pub fn new() -> Self
Sourcepub fn destination<C: Into<Box<dyn Chain>>>(
self,
name: &str,
description: &str,
chain: C,
) -> Self
pub fn destination<C: Into<Box<dyn Chain>>>( self, name: &str, description: &str, chain: C, ) -> Self
Adds a destination. The LLM sees name and description, so make the description
say what inputs the chain is good for.
Sourcepub fn default_chain<C: Into<Box<dyn Chain>>>(self, chain: C) -> Self
pub fn default_chain<C: Into<Box<dyn Chain>>>(self, chain: C) -> Self
Runs when no destination fits.
Sourcepub fn input_key(self, key: &str) -> Self
pub fn input_key(self, key: &str) -> Self
Input key holding the text to route (default input). Every input is forwarded
to the destination as is.
Sourcepub fn output_key(self, key: &str) -> Self
pub fn output_key(self, key: &str) -> Self
Output key of the answer in execute (default output).
pub fn build(self) -> Result<RouterChain, ChainError>
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for RouterChainBuilder
impl !UnwindSafe for RouterChainBuilder
impl Freeze for RouterChainBuilder
impl Send for RouterChainBuilder
impl Sync for RouterChainBuilder
impl Unpin for RouterChainBuilder
impl UnsafeUnpin for RouterChainBuilder
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ErasedDestructor for Twhere
T: 'static,
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