pub struct Agent { /* private fields */ }Implementations§
Source§impl Agent
impl Agent
pub fn new(options: AgentOptions) -> Self
pub async fn state(&self) -> AgentState
pub async fn set_system_prompt(&self, system_prompt: impl Into<String>)
pub async fn set_model(&self, model: Model)
pub async fn set_thinking_level(&self, thinking_level: ModelThinkingLevel)
pub async fn set_tools(&self, tools: Vec<DynAgentTool>)
pub async fn clear_tools(&self)
pub async fn set_messages(&self, messages: Vec<AgentMessage>)
pub async fn push_message(&self, message: AgentMessage)
pub async fn clear_messages(&self)
pub async fn set_session_id(&self, session_id: Option<String>)
pub async fn session_id(&self) -> Option<String>
pub async fn set_options(&self, options: SimpleStreamOptions)
pub async fn options(&self) -> SimpleStreamOptions
pub async fn set_transport(&self, transport: Option<Transport>)
pub async fn set_thinking_budgets( &self, thinking_budgets: Option<ThinkingBudgets>, )
pub async fn set_max_retry_delay_ms(&self, max_retry_delay_ms: Option<u64>)
pub async fn set_tool_execution(&self, tool_execution: ToolExecutionMode)
pub async fn tool_execution(&self) -> ToolExecutionMode
pub fn subscribe<F, Fut>(&self, listener: F) -> AgentSubscriptionwhere
F: Fn(AgentEvent, CancellationToken) -> Fut + Send + Sync + 'static,
Fut: Future<Output = AgentResult<()>> + Send + 'static,
pub async fn steer(&self, message: AgentMessage)
pub async fn follow_up(&self, message: AgentMessage)
pub async fn set_steering_mode(&self, mode: QueueMode)
pub async fn steering_mode(&self) -> QueueMode
pub async fn set_follow_up_mode(&self, mode: QueueMode)
pub async fn follow_up_mode(&self) -> QueueMode
pub async fn clear_steering_queue(&self)
pub async fn clear_follow_up_queue(&self)
pub async fn clear_all_queues(&self)
pub async fn has_queued_messages(&self) -> bool
pub async fn abort(&self)
pub async fn cancellation_token(&self) -> Option<CancellationToken>
pub async fn wait_for_idle(&self)
pub async fn reset(&self)
pub async fn prompt_text( &self, input: impl Into<String>, images: Vec<ImageContent>, ) -> AgentResult<()>
pub async fn prompt_messages( &self, messages: Vec<AgentMessage>, ) -> AgentResult<()>
pub async fn continue_run(&self) -> AgentResult<()>
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