Skip to content

Commit b7ffaed

Browse files
authored
fix(code_interpreter): improve code_interpreter docstring (#215)
- Add docstring to code_interpreter to allow usage with other agents (like langgraph) BREAKING CHANGE: None - It’s only an improvement with a comment Fixes #214
1 parent d16b5d1 commit b7ffaed

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/strands_tools/code_interpreter/code_interpreter.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,22 @@ def __init__(self):
192192

193193
@tool
194194
def code_interpreter(self, code_interpreter_input: CodeInterpreterInput) -> Dict[str, Any]:
195+
"""
196+
Execute code in isolated sandbox environments.
197+
198+
Usage with Strands Agent:
199+
```python
200+
code_interpreter = AgentCoreCodeInterpreter(region="us-west-2")
201+
agent = Agent(tools=[code_interpreter.code_interpreter])
202+
```
203+
204+
Args:
205+
code_interpreter_input: Structured input containing the action to perform.
206+
207+
Returns:
208+
Dict containing execution results.
209+
"""
210+
195211
# Auto-start platform on first use
196212
if not self._started:
197213
self._start()

0 commit comments

Comments
 (0)