Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -15,6 +15,14 @@ def say_hi(name: str) -> str:
|
|
15 |
name: one of pepole's name
|
16 |
"""
|
17 |
return f"Hi '{name}', Can I help you?"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
|
19 |
@tool
|
20 |
def my_custom_tool(arg1:str, arg2:int)-> str: #it's import to specify the return type
|
@@ -63,7 +71,7 @@ with open("prompts.yaml", 'r') as stream:
|
|
63 |
|
64 |
agent = CodeAgent(
|
65 |
model=model,
|
66 |
-
tools=[final_answer,say_hi], ## add your tools here (don't remove final answer)
|
67 |
max_steps=6,
|
68 |
verbosity_level=1,
|
69 |
grammar=None,
|
|
|
15 |
name: one of pepole's name
|
16 |
"""
|
17 |
return f"Hi '{name}', Can I help you?"
|
18 |
+
|
19 |
+
@tool
|
20 |
+
def buy(something: str) -> str:
|
21 |
+
"""A tool that user want to buy something
|
22 |
+
Args:
|
23 |
+
something: anything that user want to buy
|
24 |
+
"""
|
25 |
+
return f"shit, you have no money to buy '{something}'"
|
26 |
|
27 |
@tool
|
28 |
def my_custom_tool(arg1:str, arg2:int)-> str: #it's import to specify the return type
|
|
|
71 |
|
72 |
agent = CodeAgent(
|
73 |
model=model,
|
74 |
+
tools=[buy,final_answer,say_hi], ## add your tools here (don't remove final answer)
|
75 |
max_steps=6,
|
76 |
verbosity_level=1,
|
77 |
grammar=None,
|