Skip to content

Commit d2cd302

Browse files
authored
fix: Call-out that direct method calls must used keyword arguments (#209)
Follow-up to #194 where examples were not using keyword arguments and thus not working correctly. Co-authored-by: Mackenzie Zastrow <zastrowm@users.noreply.github.com>
1 parent b14afa7 commit d2cd302

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

docs/user-guide/concepts/tools/tools_overview.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,13 @@ Every tool added to an agent also becomes a method accessible directly on the ag
7676
result = agent.tool.file_read(path="/path/to/file.txt", mode="view")
7777
```
7878

79+
When calling tools directly as methods, always use keyword arguments - positional arguments are *not* supported for direct method calls:
80+
81+
```python
82+
# This will NOT work - positional arguments are not supported
83+
result = agent.tool.file_read("/path/to/file.txt", "view") # ❌ Don't do this
84+
```
85+
7986
If a tool name contains hyphens, you can invoke the tool using underscores instead:
8087

8188
```python

0 commit comments

Comments
 (0)