Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -45,6 +45,18 @@ def get_multiplication_numbers(arg1:int, arg2:int) -> int:
|
|
45 |
except Exception as e:
|
46 |
return f"Error calculation of multiplication"
|
47 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
final_answer = FinalAnswerTool()
|
49 |
model = HfApiModel(
|
50 |
max_tokens=2096,
|
@@ -62,7 +74,7 @@ with open("prompts.yaml", 'r') as stream:
|
|
62 |
|
63 |
agent = CodeAgent(
|
64 |
model=model,
|
65 |
-
tools=[final_answer, get_current_time_in_timezone, get_multiplication_numbers], # add your tools here (don't remove final_answer)
|
66 |
max_steps=6,
|
67 |
verbosity_level=1,
|
68 |
grammar=None,
|
|
|
45 |
except Exception as e:
|
46 |
return f"Error calculation of multiplication"
|
47 |
|
48 |
+
@tool
|
49 |
+
def get_adding_numbers(arg1:int, arg2:int) -> int:
|
50 |
+
"""A tool that calculates the addition of given numbers.
|
51 |
+
Args:
|
52 |
+
arg1: a valid integer number.
|
53 |
+
arg2: a valid integer number.
|
54 |
+
"""
|
55 |
+
try:
|
56 |
+
return arg1+arg2
|
57 |
+
except Exception as e:
|
58 |
+
return f"Error calculation of addition"
|
59 |
+
|
60 |
final_answer = FinalAnswerTool()
|
61 |
model = HfApiModel(
|
62 |
max_tokens=2096,
|
|
|
74 |
|
75 |
agent = CodeAgent(
|
76 |
model=model,
|
77 |
+
tools=[final_answer, get_current_time_in_timezone, get_multiplication_numbers, get_adding_numbers], # add your tools here (don't remove final_answer)
|
78 |
max_steps=6,
|
79 |
verbosity_level=1,
|
80 |
grammar=None,
|