Skip to content

Commit aacd5aa

Browse files
committed
docs: fix method name from toAgent to to_agent
- Update all references to use correct Python method name to_agent() - Maintain consistency with actual implementation 🤖 Assisted by Amazon Q Developer
1 parent 446b90b commit aacd5aa

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

docs/user-guide/concepts/experimental/agent-config.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ The experimental `AgentConfig` provides a declarative way to create configuratio
1010
`AgentConfig` allows you to:
1111

1212
- 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
1414
- Integrate with ToolBox for advanced tool management
1515
- Use standardized configuration interfaces
1616

@@ -28,7 +28,7 @@ config = AgentConfig({
2828
})
2929

3030
# Create agent instance (uses default tools from strands_tools)
31-
agent = config.toAgent()
31+
agent = config.to_agent()
3232
```
3333

3434
### Using Default Tools
@@ -44,7 +44,7 @@ config = AgentConfig({
4444
"prompt": "You are a helpful assistant with file and web capabilities"
4545
})
4646

47-
agent = config.toAgent()
47+
agent = config.to_agent()
4848

4949
# Agent now has access to default tools
5050
response = agent("Read the contents of README.md and summarize it")
@@ -64,7 +64,7 @@ config = AgentConfig({
6464
"tools": ["file_read", "editor"] # Only file operations, no web/shell
6565
})
6666

67-
agent = config.toAgent()
67+
agent = config.to_agent()
6868
```
6969

7070
!!! warning "Requires strands_tools"
@@ -77,7 +77,7 @@ Configuration files must use the `file://` prefix:
7777
```python
7878
# Load from JSON file
7979
config = AgentConfig("file:///path/to/config.json")
80-
agent = config.toAgent()
80+
agent = config.to_agent()
8181
```
8282

8383
Example `config.json`:
@@ -105,7 +105,7 @@ config = AgentConfig({
105105
"prompt": "You are a helpful assistant with access to tools"
106106
})
107107

108-
agent = config.toAgent(tools=tools)
108+
agent = config.to_agent(tools=tools)
109109
```
110110

111111
## Configuration Options
@@ -118,14 +118,14 @@ agent = config.toAgent(tools=tools)
118118

119119
### Method Parameters
120120

121-
The `toAgent()` method accepts:
121+
The `to_agent()` method accepts:
122122

123123
- `tools`: Optional ToolBox instance to override the configured tools
124124
- `**kwargs`: Additional Agent constructor parameters that override config values
125125

126126
```python
127127
# Override config values
128-
agent = config.toAgent(
128+
agent = config.to_agent(
129129
tools=my_tools,
130130
temperature=0.7,
131131
max_tokens=1000
@@ -181,7 +181,7 @@ config = AgentConfig({
181181
"tools": ["calculator", "web_search"] # Only these will be available
182182
}, tool_box=platform_tools)
183183

184-
agent = config.toAgent() # Agent has only calculator and web_search
184+
agent = config.to_agent() # Agent has only calculator and web_search
185185
```
186186

187187
## File Path Requirements
@@ -287,7 +287,7 @@ try:
287287
}, tool_box=tools)
288288

289289
# Create agent with selected tools
290-
agent = config.toAgent(temperature=0.3)
290+
agent = config.to_agent(temperature=0.3)
291291

292292
# Use the agent
293293
response = agent("Calculate the compound interest on $1000 at 5% for 3 years")

docs/user-guide/concepts/experimental/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Strands Agents includes experimental features that provide enhanced functionalit
1111
Declarative configuration-based agent creation with enhanced instantiation patterns.
1212

1313
- Create configuration-based agents from JSON files or dictionaries
14-
- Use the `toAgent()` method for clean agent instantiation
14+
- Use the `to_agent()` method for clean agent instantiation
1515
- Standardized configuration interfaces with `file://` prefix support
1616
- Integration with ToolBox for advanced tool management
1717

@@ -48,7 +48,7 @@ config = AgentConfig({
4848
})
4949

5050
# Create agent
51-
agent = config.toAgent(tools=tools)
51+
agent = config.to_agent(tools=tools)
5252

5353
# Use the agent
5454
response = agent("What time is it and what's 15 * 24?")

docs/user-guide/concepts/experimental/tool-box.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def create_customer_agent(selected_tool_names: list[str], customer_config: dict)
6464
config = AgentConfig(customer_config)
6565

6666
# Return configured agent with selected tools
67-
return config.toAgent(tools=customer_tools)
67+
return config.to_agent(tools=customer_tools)
6868

6969
# Customer usage
7070
my_agent = create_customer_agent(
@@ -216,7 +216,7 @@ config = AgentConfig({
216216
})
217217

218218
# Create agent with tools
219-
agent = config.toAgent(tools=tools)
219+
agent = config.to_agent(tools=tools)
220220
```
221221

222222
## Mixed Tool Types
@@ -291,7 +291,7 @@ config = AgentConfig({
291291
})
292292

293293
# Create agent with all tools
294-
agent = config.toAgent(tools=pool)
294+
agent = config.to_agent(tools=pool)
295295

296296
# Use the agent
297297
response = agent("Calculate the compound interest on $1000 at 5% for 3 years")

0 commit comments

Comments
 (0)