pub struct Agent { /* private fields */ }Expand description
Main agent
Implementations§
Source§impl Agent
impl Agent
pub fn new(api_key: String, function_factory: FunctionFactory) -> Self
pub fn with_model(self, model: impl Into<String>) -> Self
pub fn with_base_url(self, base_url: impl Into<String>) -> Self
pub fn with_max_iterations(self, max_iterations: usize) -> Self
pub fn with_max_tokens(self, max_tokens: Option<u32>) -> Self
pub fn with_timeout(self, timeout: Duration) -> Self
pub fn with_completion_schema<T: CompletionSchema>(self) -> Self
pub fn clear_completion_schema(self) -> Self
pub async fn run(&self, prompt: &str) -> Result<String>
pub fn from_env() -> Result<Self>
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Agent
impl !UnwindSafe for Agent
impl Freeze for Agent
impl Send for Agent
impl Sync for Agent
impl Unpin for Agent
impl UnsafeUnpin for Agent
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