pub struct AgentBuilder { /* private fields */ }Expand description
Builder for Agent with a fluent API. Mirrors the TS new Agent(opts).
Implementations§
Source§impl AgentBuilder
impl AgentBuilder
pub fn new() -> Self
pub fn model(self, model: Model) -> Self
pub fn system_prompt(self, prompt: impl Into<String>) -> Self
pub fn thinking_level(self, level: ThinkingLevel) -> Self
pub fn tools(self, tools: Vec<Arc<dyn AgentTool>>) -> Self
pub fn messages(self, messages: Vec<AgentMessage>) -> Self
pub fn stream_fn(self, stream_fn: StreamFn) -> Self
pub fn convert_to_llm(self, f: ConvertToLlm) -> Self
pub fn queue_mode(self, mode: QueueMode) -> Self
pub fn follow_up_mode(self, mode: QueueMode) -> Self
pub fn tool_execution(self, mode: ToolExecutionMode) -> Self
pub fn session_id(self, id: impl Into<String>) -> Self
Sourcepub fn build(self) -> Result<Agent, AgentError>
pub fn build(self) -> Result<Agent, AgentError>
Build the Agent. Errors if no stream_fn was supplied and no default
has been installed process-wide.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for AgentBuilder
impl !UnwindSafe for AgentBuilder
impl Freeze for AgentBuilder
impl Send for AgentBuilder
impl Sync for AgentBuilder
impl Unpin for AgentBuilder
impl UnsafeUnpin for AgentBuilder
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