@@ -10,7 +10,7 @@ The experimental `AgentConfig` provides a declarative way to create configuratio
10
10
` AgentConfig ` allows you to:
11
11
12
12
- Create configuration-based agents from JSON files or dictionaries
13
- - Use the ` toAgent ()` method for clean agent instantiation
13
+ - Use the ` to_agent ()` method for clean agent instantiation
14
14
- Integrate with ToolBox for advanced tool management
15
15
- Use standardized configuration interfaces
16
16
@@ -28,7 +28,7 @@ config = AgentConfig({
28
28
})
29
29
30
30
# Create agent instance (uses default tools from strands_tools)
31
- agent = config.toAgent ()
31
+ agent = config.to_agent ()
32
32
```
33
33
34
34
### Using Default Tools
@@ -44,7 +44,7 @@ config = AgentConfig({
44
44
" prompt" : " You are a helpful assistant with file and web capabilities"
45
45
})
46
46
47
- agent = config.toAgent ()
47
+ agent = config.to_agent ()
48
48
49
49
# Agent now has access to default tools
50
50
response = agent(" Read the contents of README.md and summarize it" )
@@ -64,7 +64,7 @@ config = AgentConfig({
64
64
" tools" : [" file_read" , " editor" ] # Only file operations, no web/shell
65
65
})
66
66
67
- agent = config.toAgent ()
67
+ agent = config.to_agent ()
68
68
```
69
69
70
70
!!! warning "Requires strands_tools"
@@ -77,7 +77,7 @@ Configuration files must use the `file://` prefix:
77
77
``` python
78
78
# Load from JSON file
79
79
config = AgentConfig(" file:///path/to/config.json" )
80
- agent = config.toAgent ()
80
+ agent = config.to_agent ()
81
81
```
82
82
83
83
Example ` config.json ` :
@@ -105,7 +105,7 @@ config = AgentConfig({
105
105
" prompt" : " You are a helpful assistant with access to tools"
106
106
})
107
107
108
- agent = config.toAgent (tools = tools)
108
+ agent = config.to_agent (tools = tools)
109
109
```
110
110
111
111
## Configuration Options
@@ -118,14 +118,14 @@ agent = config.toAgent(tools=tools)
118
118
119
119
### Method Parameters
120
120
121
- The ` toAgent ()` method accepts:
121
+ The ` to_agent ()` method accepts:
122
122
123
123
- ` tools ` : Optional ToolBox instance to override the configured tools
124
124
- ` **kwargs ` : Additional Agent constructor parameters that override config values
125
125
126
126
``` python
127
127
# Override config values
128
- agent = config.toAgent (
128
+ agent = config.to_agent (
129
129
tools = my_tools,
130
130
temperature = 0.7 ,
131
131
max_tokens = 1000
@@ -181,7 +181,7 @@ config = AgentConfig({
181
181
" tools" : [" calculator" , " web_search" ] # Only these will be available
182
182
}, tool_box = platform_tools)
183
183
184
- agent = config.toAgent () # Agent has only calculator and web_search
184
+ agent = config.to_agent () # Agent has only calculator and web_search
185
185
```
186
186
187
187
## File Path Requirements
287
287
}, tool_box = tools)
288
288
289
289
# Create agent with selected tools
290
- agent = config.toAgent (temperature = 0.3 )
290
+ agent = config.to_agent (temperature = 0.3 )
291
291
292
292
# Use the agent
293
293
response = agent(" Calculate the compound interest on $1000 at 5% f or 3 years" )
0 commit comments