pub struct LlmTextAgent { /* private fields */ }Expand description
Core text agent — calls BaseLlm::generate(), dispatches tools, loops
until the model produces a final text response.
Implementations§
Source§impl LlmTextAgent
impl LlmTextAgent
Sourcepub fn new(name: impl Into<String>, llm: Arc<dyn BaseLlm>) -> Self
pub fn new(name: impl Into<String>, llm: Arc<dyn BaseLlm>) -> Self
Create a new LLM text agent.
Sourcepub fn instruction(self, inst: impl Into<String>) -> Self
pub fn instruction(self, inst: impl Into<String>) -> Self
Set the system instruction.
Sourcepub fn tools(self, dispatcher: Arc<ToolDispatcher>) -> Self
pub fn tools(self, dispatcher: Arc<ToolDispatcher>) -> Self
Set the tool dispatcher.
Sourcepub fn temperature(self, t: f32) -> Self
pub fn temperature(self, t: f32) -> Self
Set temperature.
Sourcepub fn max_output_tokens(self, n: u32) -> Self
pub fn max_output_tokens(self, n: u32) -> Self
Set max output tokens.
Trait Implementations§
Source§impl TextAgent for LlmTextAgent
impl TextAgent for LlmTextAgent
Source§fn run<'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 State,
) -> Pin<Box<dyn Future<Output = Result<String, AgentError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn run<'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 State,
) -> Pin<Box<dyn Future<Output = Result<String, AgentError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Execute this agent. Reads/writes
state. Returns the final text output.Auto Trait Implementations§
impl Freeze for LlmTextAgent
impl !RefUnwindSafe for LlmTextAgent
impl Send for LlmTextAgent
impl Sync for LlmTextAgent
impl Unpin for LlmTextAgent
impl UnsafeUnpin for LlmTextAgent
impl !UnwindSafe for LlmTextAgent
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