Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -3,7 +3,7 @@ import datetime
|
|
3 |
import requests
|
4 |
import pytz
|
5 |
import yaml
|
6 |
-
from tools.final_answer import FinalAnswerTool
|
7 |
|
8 |
from Gradio_UI import GradioUI
|
9 |
|
@@ -18,6 +18,18 @@ def my_custom_tool(arg1:str, arg2:int)-> str: #it's import to specify the return
|
|
18 |
"""
|
19 |
return "What magic will you build ?"
|
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.
|
@@ -35,6 +47,7 @@ def get_current_time_in_timezone(timezone: str) -> str:
|
|
35 |
|
36 |
|
37 |
final_answer = FinalAnswerTool()
|
|
|
38 |
|
39 |
# If the agent does not answer, the model is overloaded, please use another model or the following Hugging Face Endpoint that also contains qwen2.5 coder:
|
40 |
# model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud'
|
@@ -55,7 +68,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,
|
|
|
3 |
import requests
|
4 |
import pytz
|
5 |
import yaml
|
6 |
+
from tools.final_answer import FinalAnswerTool, DuckDuckGoSearchTool
|
7 |
|
8 |
from Gradio_UI import GradioUI
|
9 |
|
|
|
18 |
"""
|
19 |
return "What magic will you build ?"
|
20 |
|
21 |
+
# Below is an example of a tool that does nothing. Amaze us with your creativity !
|
22 |
+
@tool
|
23 |
+
def find_stock_ticker_symbol(company_name:str)-> str: #it's import to specify the return type
|
24 |
+
#Keep this format for the description / args / args description but feel free to modify the tool
|
25 |
+
"""A tool that fetches the stock ticker symbol of company listed in National Stock Exchange, India
|
26 |
+
Args:
|
27 |
+
company_name: The name of valid company listed in National Stock Exchage, India
|
28 |
+
"""
|
29 |
+
search_result=DuckDuckGoSearchTool()
|
30 |
+
|
31 |
+
return "What magic will you build ?"
|
32 |
+
|
33 |
@tool
|
34 |
def get_current_time_in_timezone(timezone: str) -> str:
|
35 |
"""A tool that fetches the current local time in a specified timezone.
|
|
|
47 |
|
48 |
|
49 |
final_answer = FinalAnswerTool()
|
50 |
+
search_result=DuckDuckGoSearchTool()
|
51 |
|
52 |
# If the agent does not answer, the model is overloaded, please use another model or the following Hugging Face Endpoint that also contains qwen2.5 coder:
|
53 |
# model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud'
|
|
|
68 |
|
69 |
agent = CodeAgent(
|
70 |
model=model,
|
71 |
+
tools=[final_answer],## add your tools here (don't remove final answer)
|
72 |
max_steps=6,
|
73 |
verbosity_level=1,
|
74 |
grammar=None,
|