Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 36 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ Below is a comprehensive table of all available tools, how to use them with an a
| exa_search | `agent.tool.exa_search(query="Best project management tools", text=True)` | Intelligent web search with auto mode (default) that combines neural and keyword search for optimal results |
| exa_get_contents | `agent.tool.exa_get_contents(urls=["https://example.com/article"], text=True, summary={"query": "key points"})` | Extract full content and summaries from specific URLs with live crawling fallback |
| python_repl* | `agent.tool.python_repl(code="import pandas as pd\ndf = pd.read_csv('data.csv')\nprint(df.head())")` | Running Python code snippets, data analysis, executing complex logic with user confirmation for security |
| programmatic_tool_caller* | `agent.tool.programmatic_tool_caller(code="result = await calculator(expression='2+2'); print(result)")` | Execute Python code with tools as async functions. Code runs in async context automatically |
| calculator | `agent.tool.calculator(expression="2 * sin(pi/4) + log(e**2)")` | Performing mathematical operations, symbolic math, equation solving |
| code_interpreter | `code_interpreter = AgentCoreCodeInterpreter(region="us-west-2"); agent = Agent(tools=[code_interpreter.code_interpreter])` | Execute code in isolated sandbox environments with multi-language support (Python, JavaScript, TypeScript), persistent sessions, and file operations |
| use_aws | `agent.tool.use_aws(service_name="s3", operation_name="list_buckets", parameters={}, region="us-west-2")` | Interacting with AWS services, cloud resource management |
Expand Down Expand Up @@ -409,6 +410,41 @@ processed.head()
""")
```

### Programmatic Tool Calling

*Note: `programmatic_tool_caller` does not work on Windows.*

```python
from strands import Agent
from strands_tools import programmatic_tool_caller, calculator

agent = Agent(tools=[programmatic_tool_caller, calculator])

# Code runs in async context automatically - just use await
result = agent.tool.programmatic_tool_caller(
code="""
# Simple tool call
result = await calculator(expression="2 + 2")
print(f"Result: {result}")

# Loop with tool calls
total = 0
for i in range(1, 6):
square = await calculator(expression=f"{i} ** 2")
total += int(square)
print(f"Sum of squares: {total}")

# Parallel execution
results = await asyncio.gather(
calculator(expression="10 * 1"),
calculator(expression="10 * 2"),
calculator(expression="10 * 3"),
)
print(f"Parallel results: {results}")
"""
)
```

### Code Interpreter

```python
Expand Down
Loading