pub struct AgentConfig {
pub max_turns: Option<usize>,
pub max_tokens: Option<u32>,
pub system_prompt: String,
pub model: String,
pub retry: RetryConfig,
pub streaming: bool,
pub tool_timeout_ms: Option<u64>,
}Expand description
Configuration for the agent loop
Fields§
§max_turns: Option<usize>Maximum number of turns (LLM round-trips) before stopping
max_tokens: Option<u32>Maximum tokens per response.
If None, the SDK uses the provider/model-specific default.
system_prompt: StringSystem prompt for the agent
model: StringModel identifier
retry: RetryConfigRetry configuration for transient errors
streaming: boolEnable streaming responses from the LLM.
When true, emits TextDelta and ThinkingDelta events as text arrives
in real-time. When false (default), waits for the complete response
before emitting Text and Thinking events.
tool_timeout_ms: Option<u64>Optional per-tool execution timeout in milliseconds.
When set, the agent loop races each tool’s execute() future
against this budget at the SDK boundary (mirroring
SubagentConfig::timeout_ms). A tool that exceeds the budget is
stopped and reported with a synthetic timeout ToolResult, keeping
the tool_use / tool_result history balanced even for
non-cooperative tools. None (default) disables the boundary
timeout entirely.
Trait Implementations§
Source§impl Clone for AgentConfig
impl Clone for AgentConfig
Source§fn clone(&self) -> AgentConfig
fn clone(&self) -> AgentConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more