pub struct AgentOptions {Show 13 fields
pub model: Option<String>,
pub api_key: Option<String>,
pub base_url: Option<String>,
pub cwd: Option<String>,
pub system_prompt: Option<String>,
pub max_turns: Option<u32>,
pub max_budget_usd: Option<f64>,
pub max_tokens: Option<u32>,
pub tools: Vec<ToolDefinition>,
pub allowed_tools: Vec<String>,
pub disallowed_tools: Vec<String>,
pub mcp_servers: Option<HashMap<String, McpServerConfig>>,
pub on_event: Option<Arc<dyn Fn(AgentEvent) + Send + Sync>>,
}Fields§
§model: Option<String>§api_key: Option<String>§base_url: Option<String>§cwd: Option<String>§system_prompt: Option<String>§max_turns: Option<u32>§max_budget_usd: Option<f64>§max_tokens: Option<u32>§tools: Vec<ToolDefinition>§allowed_tools: Vec<String>§disallowed_tools: Vec<String>§mcp_servers: Option<HashMap<String, McpServerConfig>>MCP server configurations
on_event: Option<Arc<dyn Fn(AgentEvent) + Send + Sync>>Callback for agent events (tool start/complete/error, thinking, done) This is not serializable, so only available at runtime
Trait Implementations§
Source§impl Clone for AgentOptions
impl Clone for AgentOptions
Source§fn clone(&self) -> AgentOptions
fn clone(&self) -> AgentOptions
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for AgentOptions
impl Default for AgentOptions
Source§impl<'de> Deserialize<'de> for AgentOptions
impl<'de> Deserialize<'de> for AgentOptions
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<AgentOptions> for Agent
impl From<AgentOptions> for Agent
Source§fn from(options: AgentOptions) -> Self
fn from(options: AgentOptions) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for AgentOptions
impl !RefUnwindSafe for AgentOptions
impl Send for AgentOptions
impl Sync for AgentOptions
impl Unpin for AgentOptions
impl UnsafeUnpin for AgentOptions
impl !UnwindSafe for AgentOptions
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