Struct LlmTextAgent
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§
§impl LlmTextAgent
impl LlmTextAgent
pub fn new(name: impl Into<String>, llm: Arc<dyn BaseLlm>) -> LlmTextAgent
pub fn new(name: impl Into<String>, llm: Arc<dyn BaseLlm>) -> LlmTextAgent
Create a new LLM text agent.
pub fn instruction(self, inst: impl Into<String>) -> LlmTextAgent
pub fn instruction(self, inst: impl Into<String>) -> LlmTextAgent
Set the system instruction.
pub fn tools(self, dispatcher: Arc<ToolDispatcher>) -> LlmTextAgent
pub fn tools(self, dispatcher: Arc<ToolDispatcher>) -> LlmTextAgent
Set the tool dispatcher.
pub fn temperature(self, t: f32) -> LlmTextAgent
pub fn temperature(self, t: f32) -> LlmTextAgent
Set temperature.
pub fn max_output_tokens(self, n: u32) -> LlmTextAgent
pub fn max_output_tokens(self, n: u32) -> LlmTextAgent
Set max output tokens.
Trait Implementations§
§impl TextAgent for LlmTextAgent
impl TextAgent for LlmTextAgent
§fn run<'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 State,
) -> Pin<Box<dyn Future<Output = Result<String, AgentError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
LlmTextAgent: '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
'life0: 'async_trait,
'life1: 'async_trait,
LlmTextAgent: '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 !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