Skip to content

Commit b973366

Browse files
refactor(tools): rename handle_tool_call to handle_call for consistency across tool handlers
1 parent b3b1e69 commit b973366

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

CREATING_TOOLS.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ tool_definition = {
3939
}
4040

4141

42-
def handle_tool_call(input_data):
42+
def handle_call(input_data):
4343
"""
4444
Process the tool call with the given input data.
4545
@@ -76,9 +76,9 @@ TOOLS = [
7676
]
7777

7878
TOOL_HANDLERS = {
79-
"bash": bash.handle_tool_call,
79+
"bash": bash.handle_call,
8080
# ... other handler mappings
81-
"my_tool": my_tool.handle_tool_call, # Add your tool handler here
81+
"my_tool": my_tool.handle_call, # Add your tool handler here
8282
}
8383
```
8484

@@ -143,7 +143,7 @@ Follow these functional programming principles:
143143
Example of a handler with proper error handling:
144144

145145
```python
146-
def handle_tool_call(input_data):
146+
def handle_call(input_data):
147147
try:
148148
# Validate required inputs
149149
if "required_param" not in input_data:
@@ -176,7 +176,7 @@ API_KEY = os.getenv("MY_TOOL_API_KEY")
176176
BASE_URL = os.getenv("MY_TOOL_BASE_URL")
177177

178178
# Then check these in your handler:
179-
def handle_tool_call(input_data):
179+
def handle_call(input_data):
180180
if not API_KEY or not BASE_URL:
181181
return "❌ Missing required environment variables in .env"
182182

@@ -234,7 +234,7 @@ tool_definition = {
234234
}
235235
}
236236

237-
def handle_tool_call(input_data):
237+
def handle_call(input_data):
238238
if not WEATHER_API_KEY:
239239
return "❌ Missing WEATHER_API_KEY environment variable"
240240

0 commit comments

Comments
 (0)