Spaces:
Running
Running
Update app.py
Browse filesadd test stock price function
app.py
CHANGED
@@ -17,7 +17,18 @@ def meow_tool(name:str, counts:int)-> str: #it's import to specify the return ty
|
|
17 |
counts: the second argument , times to meow
|
18 |
"""
|
19 |
return f"Meow to {name}" + f" meow " * counts + f"!"
|
20 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
21 |
@tool
|
22 |
def get_current_time_in_timezone(timezone: str) -> str:
|
23 |
"""A tool that fetches the current local time in a specified timezone.
|
@@ -55,7 +66,7 @@ with open("prompts.yaml", 'r') as stream:
|
|
55 |
|
56 |
agent = CodeAgent(
|
57 |
model=model,
|
58 |
-
tools=[final_answer,
|
59 |
max_steps=6,
|
60 |
verbosity_level=1,
|
61 |
grammar=None,
|
|
|
17 |
counts: the second argument , times to meow
|
18 |
"""
|
19 |
return f"Meow to {name}" + f" meow " * counts + f"!"
|
20 |
+
@tool
|
21 |
+
def get_stock_price(name:str) -> str:
|
22 |
+
"""
|
23 |
+
A tool that search for company stock price use DuckDuckGoSearchTool.
|
24 |
+
Args:
|
25 |
+
name : the company name.
|
26 |
+
|
27 |
+
"""
|
28 |
+
stock_price = DuckDuckGoSearchTool(f"what is the stock price of {name}")
|
29 |
+
|
30 |
+
returns f"name: {stock_price}"
|
31 |
+
|
32 |
@tool
|
33 |
def get_current_time_in_timezone(timezone: str) -> str:
|
34 |
"""A tool that fetches the current local time in a specified timezone.
|
|
|
66 |
|
67 |
agent = CodeAgent(
|
68 |
model=model,
|
69 |
+
tools=[final_answer, meow_toolm, get_current_time_in_timezone, image_generation_tool], ## add your tools here (don't remove final answer)
|
70 |
max_steps=6,
|
71 |
verbosity_level=1,
|
72 |
grammar=None,
|