pub struct ChatbotBuilder<A> { /* private fields */ }Expand description
Builder pattern for CLI chatbots.
§Example
let chatbot = ChatbotBuilder::new().agent(my_agent).show_usage().build();
chatbot.run().await?;Implementations§
Source§impl ChatbotBuilder<AgentNotSet>
impl ChatbotBuilder<AgentNotSet>
pub fn new() -> ChatbotBuilder<AgentNotSet>
Sourcepub fn agent<M>(self, agent: Agent<M>) -> ChatbotBuilder<Agent<M>>where
M: CompletionModel + 'static,
pub fn agent<M>(self, agent: Agent<M>) -> ChatbotBuilder<Agent<M>>where
M: CompletionModel + 'static,
Sets the agent that will be used to drive the CLI interface
Source§impl<A> ChatbotBuilder<A>
impl<A> ChatbotBuilder<A>
Sourcepub fn show_usage(self) -> ChatbotBuilder<A>
pub fn show_usage(self) -> ChatbotBuilder<A>
Sets the show_usage flag, so that after a request the number of tokens
in the input and output will be printed
Sourcepub fn multi_turn_depth(self, multi_turn_depth: usize) -> ChatbotBuilder<A>
pub fn multi_turn_depth(self, multi_turn_depth: usize) -> ChatbotBuilder<A>
Sets the maximum depth for multi-turn, i.e. toolcalls
Source§impl<M> ChatbotBuilder<Agent<M>>where
M: CompletionModel + 'static,
impl<M> ChatbotBuilder<Agent<M>>where
M: CompletionModel + 'static,
Trait Implementations§
Source§impl Default for ChatbotBuilder<AgentNotSet>
impl Default for ChatbotBuilder<AgentNotSet>
Source§fn default() -> ChatbotBuilder<AgentNotSet>
fn default() -> ChatbotBuilder<AgentNotSet>
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl<A> Freeze for ChatbotBuilder<A>where
A: Freeze,
impl<A> RefUnwindSafe for ChatbotBuilder<A>where
A: RefUnwindSafe,
impl<A> Send for ChatbotBuilder<A>where
A: Send,
impl<A> Sync for ChatbotBuilder<A>where
A: Sync,
impl<A> Unpin for ChatbotBuilder<A>where
A: Unpin,
impl<A> UnwindSafe for ChatbotBuilder<A>where
A: UnwindSafe,
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