We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8d0d0e4 commit aec125cCopy full SHA for aec125c
examples/tools.py
@@ -12,14 +12,19 @@ def add_two_numbers(a: int, b: int) -> int:
12
Returns:
13
int: The sum of the two numbers
14
"""
15
- return a + b
+
16
+ # The cast is necessary as returned tool call arguments don't always conform exactly to schema
17
+ # E.g. this would prevent "what is 30 + 12" to produce '3012' instead of 42
18
+ return int(a) + int(b)
19
20
21
def subtract_two_numbers(a: int, b: int) -> int:
22
23
Subtract two numbers
24
- return a - b
25
26
27
+ return int(a) - int(b)
28
29
30
# Tools can still be manually defined and passed into chat
0 commit comments