openai_agents_rust/agent/
types.rs

1use crate::agent::runner::ToolUseBehavior;
2
3// Agent configuration scaffold to move toward parity with the Python SDK.
4#[derive(Clone)]
5pub struct AgentConfig {
6    pub name: String,
7    pub handoff_description: Option<String>,
8    pub model_name: Option<String>,
9    pub reset_tool_choice: bool,
10    pub instructions: Option<String>,
11    pub tool_use_behavior: ToolUseBehavior,
12}
13
14impl Default for AgentConfig {
15    fn default() -> Self {
16        Self {
17            name: String::new(),
18            handoff_description: None,
19            model_name: None,
20            reset_tool_choice: true,
21            instructions: None,
22            tool_use_behavior: ToolUseBehavior::RunLlmAgain,
23        }
24    }
25}
26
27impl AgentConfig {
28    pub fn new(name: impl Into<String>) -> Self {
29        Self {
30            name: name.into(),
31            ..Default::default()
32        }
33    }
34}