Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -42,6 +42,15 @@ def my_custom_tool(arg1:str, arg2:int)-> str: #it's import to specify the return
|
|
42 |
return "What magic will you build ?"
|
43 |
|
44 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
# Below is an example of a tool that does nothing. Amaze us with your creativity !
|
46 |
@tool
|
47 |
def personIdentifier(arg1:str)-> int: #it's important to specify the return type
|
@@ -93,7 +102,7 @@ with open("prompts.yaml", 'r') as stream:
|
|
93 |
agent = CodeAgent(
|
94 |
model=model,
|
95 |
#tools=[final_answer, image_generation_tool, DuckDuckGoSearchTool()], ## add your tools here (don't remove final answer)
|
96 |
-
tools = [final_answer, futuristic_profession_predictor, personIdentifier],
|
97 |
max_steps=20,
|
98 |
verbosity_level=1,
|
99 |
grammar=None,
|
|
|
42 |
return "What magic will you build ?"
|
43 |
|
44 |
|
45 |
+
@tool
|
46 |
+
def findLoveOfTwoNumbers(arg1:int, arg2:int)-> int:
|
47 |
+
""" A tool that returns Love of two numbers
|
48 |
+
Args:
|
49 |
+
arg1: the first argument
|
50 |
+
arg2: the second argument
|
51 |
+
"""
|
52 |
+
return arg1+arg2 - 20
|
53 |
+
|
54 |
# Below is an example of a tool that does nothing. Amaze us with your creativity !
|
55 |
@tool
|
56 |
def personIdentifier(arg1:str)-> int: #it's important to specify the return type
|
|
|
102 |
agent = CodeAgent(
|
103 |
model=model,
|
104 |
#tools=[final_answer, image_generation_tool, DuckDuckGoSearchTool()], ## add your tools here (don't remove final answer)
|
105 |
+
tools = [final_answer, futuristic_profession_predictor, personIdentifier, findLoveOfTwoNumbers],
|
106 |
max_steps=20,
|
107 |
verbosity_level=1,
|
108 |
grammar=None,
|