Skip to content

Commit 074bf20

Browse files
awsarronjsamuel1
andauthored
v0.1.2 (#21)
* docs(readme): add logo, title, badges, links to other repos (#13) * feat: upgrade to Claude Sonnet 4 model (#14) - Updated default model from claude-3-7-sonnet to claude-sonnet-4-20250514-v1:0 - Updated model_id in .prompt, README.md, and model_utils.py - Adjusted max_tokens to 32768 for Sonnet 4 compatibility - Updated documentation references to reflect latest model capabilities This upgrade provides enhanced reasoning capabilities and performance improvements. * feat: add missing tools to strands.py (#15) Adds the following tools that were missing from the imports: - cron: Crontab management and job scheduling - current_time: Current time utilities - file_read: File reading capabilities - rich_interface: Rich console interface components Also reorganizes the tools list alphabetically and removes duplicate load_tool entry for better maintainability. Note: Excludes memory tool to avoid bringing in a dependency on Bedrock Knowledgebases. * Fix AttributeError: 'dict' object has no attribute 'merge' in BedrockModel (#11) - Add type conversion for boto_client_config from dict to BotocoreConfig - Import BotocoreConfig class to handle configuration parsing - Fixes issue where JSON config parsing creates dict instead of BotocoreConfig object - Resolves 'AttributeError: dict object has no attribute merge' during model initialization * fix(readme): use logo that changes color automatically depending on user's color preference scheme (#16) * feat(tools): add file_write, memory, slack, speak, stop + remove rich_interface (#19) * feat(tools): add file_write, memory, slack, speak, stop + remove rich_interface * docs(readme): update list of tools + remove nested agent capabilities section * fix: correctly handle keyboard interrupts + stop spinners on error (#12) * v0.1.2 --------- Co-authored-by: Josh Samuel <[email protected]>
1 parent 4350047 commit 074bf20

File tree

7 files changed

+134
-73
lines changed

7 files changed

+134
-73
lines changed

.prompt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ from botocore.config import Config
182182

183183
# Configure Bedrock model with maximum capabilities
184184
model = BedrockModel(
185-
model_id="us.anthropic.claude-3-7-sonnet-20250219-v1:0",
185+
model_id="us.anthropic.claude-sonnet-4-20250514-v1:0",
186186
max_tokens=int(os.getenv("STRANDS_MAX_TOKENS", "64000")), # Maximized token output
187187
boto_client_config=Config(
188188
read_timeout=900, # 15 min timeout for long operations
@@ -378,9 +378,9 @@ export STRANDS_SYSTEM_PROMPT="Your custom prompt here"
378378
- Create agents that can collaborate through shared interfaces
379379

380380
6. **Maximizing Bedrock Performance**
381-
- Use Claude 3.7 Sonnet for best reasoning capabilities
381+
- Use the latest Claude Sonnet model available for best reasoning capabilities
382382
- Configure extended timeouts for complex reasoning tasks
383383
- Enable thinking capability with appropriate token budget
384384
- Use maximal output tokens to handle complex tool responses
385385

386-
I'm here to help you build self-extending agents that continuously evolve their capabilities through autonomous tool creation. Let's build something extraordinary together!
386+
I'm here to help you build self-extending agents that continuously evolve their capabilities through autonomous tool creation. Let's build something extraordinary together!

README.md

Lines changed: 85 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,36 @@
1-
# Strands Agent Builder
1+
<div align="center">
2+
<div>
3+
<a href="https://strandsagents.com">
4+
<img src="https://strandsagents.com/latest/assets/logo-auto.svg" alt="Strands Agents" width="55px" height="105px">
5+
</a>
6+
</div>
7+
8+
<h1>
9+
Strands Agent Builder
10+
</h1>
11+
12+
<h2>
13+
A model-driven approach to building AI agents in just a few lines of code.
14+
</h2>
15+
16+
<div align="center">
17+
<a href="https://github.com/strands-agents/agent-builder/graphs/commit-activity"><img alt="GitHub commit activity" src="https://img.shields.io/github/commit-activity/m/strands-agents/agent-builder"/></a>
18+
<a href="https://github.com/strands-agents/agent-builder/issues"><img alt="GitHub open issues" src="https://img.shields.io/github/issues/strands-agents/agent-builder"/></a>
19+
<a href="https://github.com/strands-agents/agent-builder/pulls"><img alt="GitHub open pull requests" src="https://img.shields.io/github/issues-pr/strands-agents/agent-builder"/></a>
20+
<a href="https://github.com/strands-agents/agent-builder/blob/main/LICENSE"><img alt="License" src="https://img.shields.io/github/license/strands-agents/agent-builder"/></a>
21+
<a href="https://pypi.org/project/strands-agents-builder/"><img alt="PyPI version" src="https://img.shields.io/pypi/v/strands-agents-builder"/></a>
22+
<a href="https://python.org"><img alt="Python versions" src="https://img.shields.io/pypi/pyversions/strands-agents-builder"/></a>
23+
</div>
24+
25+
<p>
26+
<a href="https://strandsagents.com/">Documentation</a>
27+
◆ <a href="https://github.com/strands-agents/samples">Samples</a>
28+
◆ <a href="https://github.com/strands-agents/sdk-python">Python SDK</a>
29+
◆ <a href="https://github.com/strands-agents/tools">Tools</a>
30+
◆ <a href="https://github.com/strands-agents/agent-builder">Agent Builder</a>
31+
◆ <a href="https://github.com/strands-agents/mcp-server">MCP Server</a>
32+
</p>
33+
</div>
234

335
An interactive Strands agent toolkit designed to help you build, test, and extend your own custom AI agents and tools. With the Strands Agent Builder, you can create specialized agents, develop custom tools, and compose complex AI workflows—all from your terminal.
436

@@ -38,18 +70,33 @@ strands --kb YOUR_KB_ID "Load my previous calculator tool and enhance it with sc
3870

3971
Strands comes with a comprehensive set of built-in tools:
4072

41-
- **shell**: Run command-line operations with interactive support
42-
- **editor**: View and edit files with syntax highlighting
43-
- **http_request**: Make API calls with authentication support
44-
- **python_repl**: Execute Python code interactively
45-
- **calculator**: Perform mathematical operations powered by SymPy
46-
- **retrieve**: Query knowledge bases for relevant information
47-
- **store_in_kb**: Save content to knowledge bases for future reference
48-
- **load_tool**: Dynamically load additional tools at runtime
73+
- **agent_graph**: Create and manage graphs of agents
74+
- **calculator**: Perform mathematical operations
75+
- **cron**: Task scheduling with cron jobs
76+
- **current_time**: Get the current date and time
77+
- **editor**: File editing operations like line edits, search, and undo
4978
- **environment**: Manage environment variables
50-
- **strands**: Create nested agent instances with specialized capabilities
51-
- **dialog**: Create interactive dialog interfaces
52-
- **use_aws**: Make AWS API calls through boto3
79+
- **generate_image**: Create AI generated images with Amazon Bedrock
80+
- **http_request**: Make API calls, fetch web data, and call local HTTP servers
81+
- **image_reader**: Process and analyze images
82+
- **journal**: Create structured tasks and logs for agents to manage and work from
83+
- **load_tool**: Dynamically load more tools at runtime
84+
- **memory**: Agent memory persistence in Amazon Bedrock Knowledge Bases
85+
- **nova_reels**: Create AI generated videos with Nova Reels on Amazon Bedrock
86+
- **python_repl**: Run Python code
87+
- **retrieve**: Semantically retrieve data from Amazon Bedrock Knowledge Bases for RAG, memory, and other purposes
88+
- **shell**: Execute shell commands
89+
- **slack**: Slack integration with real-time events, API access, and message sending
90+
- **speak**: Generate speech from text using macOS say command or Amazon Polly
91+
- **stop**: Force stop the agent event loop
92+
- **store_in_kb**: Save content to knowledge bases for future reference
93+
- **strand**: Create nested agent instances with specialized capabilities
94+
- **swarm**: Coordinate multiple AI agents in a swarm / network of agents
95+
- **think**: Perform deep thinking by creating parallel branches of agentic reasoning
96+
- **use_aws**: Interact with AWS services
97+
- **use_llm**: Run a new AI event loop with custom prompts
98+
- **welcome**: Manage the Strands Agent Builder welcome text
99+
- **workflow**: Orchestrate sequenced workflows
53100

54101
## Knowledge Base Integration
55102

@@ -70,26 +117,6 @@ Features:
70117
- 🛠️ Ability to iteratively improve tools across sessions
71118
- 🔍 Find and extend tools built in previous sessions
72119

73-
## Nested Agent Capabilities
74-
75-
Use the `strands` tool to prototype and test specialized sub-agents with their own tools and system prompts:
76-
77-
```python
78-
# Create a specialized data analysis agent
79-
agent.tool.strand(
80-
query="Build and test a data analysis agent",
81-
tool_names=["python_repl", "editor", "http_request"],
82-
system_prompt="You're an AI specialized in data analysis. Your task is to build tools for data processing and visualization."
83-
)
84-
85-
# Create a tool-building agent focused on web automation
86-
agent.tool.strand(
87-
query="Create a set of web automation tools for browser testing",
88-
tool_names=["editor", "python_repl", "shell"],
89-
system_prompt="You're an expert in creating web automation tools. Your specialty is developing reliable browser testing utilities."
90-
)
91-
```
92-
93120
## Model Configuration
94121

95122
### Optimized Defaults
@@ -98,8 +125,8 @@ Strands comes with optimized, maxed-out configuration settings for the Bedrock m
98125

99126
```json
100127
{
101-
"model_id": "us.anthropic.claude-3-7-sonnet-20250219-v1:0",
102-
"max_tokens": 64000,
128+
"model_id": "us.anthropic.claude-sonnet-4-20250514-v1:0",
129+
"max_tokens": 32767,
103130
"boto_client_config": {
104131
"read_timeout": 900,
105132
"connect_timeout": 900,
@@ -118,8 +145,8 @@ Strands comes with optimized, maxed-out configuration settings for the Bedrock m
118145
```
119146

120147
These settings provide:
121-
- Claude 3.7 Sonnet (latest high-performance model)
122-
- Maximum token output (64,000 tokens)
148+
- Claude Sonnet 4 (latest high-performance model)
149+
- Maximum token output (32,768 tokens)
123150
- Extended timeouts (15 minutes) for complex operations
124151
- Automatic retries with adaptive backoff
125152
- Enabled thinking capability with 2,048 token budget for recursive reasoning
@@ -176,22 +203,29 @@ export STRANDS_SYSTEM_PROMPT="You are a Python expert."
176203
echo "You are a security expert." > .prompt
177204
```
178205

179-
## Contributing
206+
## Exit
180207

181-
```bash
182-
git clone https://github.com/strands-agents/agent-builder.git ~/.agent-builder
183-
cd ~/.agent-builder
184-
python3 -m venv venv && source venv/bin/activate
185-
pip3 install -e .
186-
pip3 install -e ".[test]"
187-
188-
# Run tests
189-
hatch run test # Run all tests with verbose coverage output
190-
hatch run test -k test_pattern # Run specific tests matching a pattern
191-
```
208+
Type `exit`, `quit`, or press `Ctrl+C`/`Ctrl+D`
192209

193-
Testing is managed through hatch scripting in pyproject.toml.
210+
## Contributing ❤️
194211

195-
## Exit
212+
We welcome contributions! See our [Contributing Guide](CONTRIBUTING.md) for details on:
213+
- Reporting bugs & features
214+
- Development setup
215+
- Contributing via Pull Requests
216+
- Code of Conduct
217+
- Reporting of security issues
196218

197-
Type `exit`, `quit`, or press `Ctrl+C`/`Ctrl+D`
219+
## License
220+
221+
This project is licensed under the Apache License 2.0 - see the [LICENSE](LICENSE) file for details.
222+
223+
## Security
224+
225+
See [CONTRIBUTING](CONTRIBUTING.md#security-issue-notifications) for more information.
226+
227+
## ⚠️ Preview Status
228+
229+
Strands Agents is currently in public preview. During this period:
230+
- APIs may change as we refine the SDK
231+
- We welcome feedback and contributions

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "strands-agents-builder"
7-
version = "0.1.1"
7+
version = "0.1.2"
88
description = "An example Strands agent demonstrating streaming, tool use, and interactivity from your terminal. This agent builder can help you to build your own agents and tools."
99
readme = "README.md"
1010
requires-python = ">=3.10"

src/strands_agents_builder/models/bedrock.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""Create instance of SDK's Bedrock model provider."""
22

3+
from botocore.config import Config as BotocoreConfig
34
from strands.models import BedrockModel
45
from strands.types.models import Model
56
from typing_extensions import Unpack
@@ -14,5 +15,8 @@ def instance(**model_config: Unpack[BedrockModel.BedrockConfig]) -> Model:
1415
Returns:
1516
Bedrock model provider.
1617
"""
18+
# Handle conversion of boto_client_config from dict to BotocoreConfig
19+
if "boto_client_config" in model_config and isinstance(model_config["boto_client_config"], dict):
20+
model_config["boto_client_config"] = BotocoreConfig(**model_config["boto_client_config"])
1721

1822
return BedrockModel(**model_config)

src/strands_agents_builder/strands.py

Lines changed: 30 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,25 @@
1313
from strands_tools import (
1414
agent_graph,
1515
calculator,
16+
cron,
17+
current_time,
1618
editor,
1719
environment,
20+
file_read,
21+
file_write,
1822
generate_image,
1923
http_request,
2024
image_reader,
2125
journal,
2226
load_tool,
27+
memory,
2328
nova_reels,
2429
python_repl,
2530
retrieve,
2631
shell,
32+
slack,
33+
speak,
34+
stop,
2735
swarm,
2836
think,
2937
use_aws,
@@ -37,7 +45,7 @@
3745
from strands_agents_builder.utils.kb_utils import load_system_prompt, store_conversation_in_kb
3846
from strands_agents_builder.utils.welcome_utils import render_goodbye_message, render_welcome_message
3947

40-
# Custom tools, handlers, utils
48+
# Custom tools
4149
from tools import (
4250
store_in_kb,
4351
strand,
@@ -80,24 +88,31 @@ def main():
8088
system_prompt = load_system_prompt()
8189

8290
tools = [
83-
shell,
91+
agent_graph,
92+
calculator,
93+
cron,
94+
current_time,
8495
editor,
96+
environment,
97+
file_read,
98+
file_write,
99+
generate_image,
85100
http_request,
101+
image_reader,
102+
journal,
103+
load_tool,
104+
memory,
105+
nova_reels,
86106
python_repl,
87-
calculator,
88107
retrieve,
108+
shell,
109+
slack,
110+
speak,
111+
stop,
112+
swarm,
113+
think,
89114
use_aws,
90-
load_tool,
91-
environment,
92115
use_llm,
93-
think,
94-
load_tool,
95-
journal,
96-
image_reader,
97-
generate_image,
98-
nova_reels,
99-
agent_graph,
100-
swarm,
101116
workflow,
102117
# Strands tools
103118
store_in_kb,
@@ -133,7 +148,7 @@ def main():
133148
render_welcome_message(welcome_text)
134149
while True:
135150
try:
136-
user_input = get_user_input("\n~ ")
151+
user_input = get_user_input("\n~ ", default="", keyboard_interrupt_return_default=False)
137152
if user_input.lower() in ["exit", "quit"]:
138153
render_goodbye_message()
139154
break
@@ -177,6 +192,7 @@ def main():
177192
render_goodbye_message()
178193
break
179194
except Exception as e:
195+
callback_handler(force_stop=True) # Stop spinners
180196
print(f"\nError: {str(e)}")
181197

182198

src/strands_agents_builder/utils/model_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111

1212
# Default model configuration
1313
DEFAULT_MODEL_CONFIG = {
14-
"model_id": "us.anthropic.claude-3-7-sonnet-20250219-v1:0",
15-
"max_tokens": int(os.getenv("STRANDS_MAX_TOKENS", "64000")),
14+
"model_id": "us.anthropic.claude-sonnet-4-20250514-v1:0",
15+
"max_tokens": int(os.getenv("STRANDS_MAX_TOKENS", "32768")),
1616
"boto_client_config": Config(
1717
read_timeout=900,
1818
connect_timeout=900,

tests/test_strands.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ def test_interactive_mode(
4141
# Verify welcome message was rendered
4242
mock_welcome_message.assert_called_once()
4343

44+
# Verify user input was called with the correct parameters
45+
mock_user_input.assert_called_with("\n~ ", default="", keyboard_interrupt_return_default=False)
46+
4447
# Verify user input was processed
4548
mock_agent.assert_called_with("test query", system_prompt=mock.ANY)
4649

@@ -107,7 +110,7 @@ def test_empty_input(
107110
):
108111
"""Test handling of empty input"""
109112
# Setup mocks - empty input followed by exit
110-
mock_user_input.side_effect = ["", "exit"]
113+
mock_user_input.side_effect = ["", " ", "\t", "exit"]
111114

112115
# Mock sys.argv
113116
monkeypatch.setattr(sys, "argv", ["strands"])
@@ -167,7 +170,8 @@ def test_eof_error_exception(self, mock_goodbye, mock_agent, mock_input):
167170
@mock.patch.object(strands, "get_user_input")
168171
@mock.patch.object(strands, "Agent")
169172
@mock.patch.object(strands, "print")
170-
def test_general_exception_handling(self, mock_print, mock_agent, mock_input):
173+
@mock.patch.object(strands, "callback_handler")
174+
def test_general_exception_handling(self, mock_callback_handler, mock_print, mock_agent, mock_input):
171175
"""Test handling of general exceptions in interactive mode"""
172176
# Setup mocks
173177
mock_agent_instance = mock.MagicMock()
@@ -187,6 +191,9 @@ def test_general_exception_handling(self, mock_print, mock_agent, mock_input):
187191
# Verify error was printed
188192
mock_print.assert_any_call("\nError: Test error")
189193

194+
# Verify callback_handler was called to stop spinners
195+
mock_callback_handler.assert_called_once_with(force_stop=True)
196+
190197

191198
class TestCommandLine:
192199
"""Test cases for command line mode functionality"""

0 commit comments

Comments
 (0)