Spaces:
Sleeping
Sleeping
Update app.py
Browse filesmy_crypto_search_analyse_tool
app.py
CHANGED
|
@@ -9,14 +9,28 @@ from Gradio_UI import GradioUI
|
|
| 9 |
|
| 10 |
# Below is an example of a tool that does nothing. Amaze us with your creativity !
|
| 11 |
@tool
|
| 12 |
-
def
|
| 13 |
#Keep this format for the description / args / args description but feel free to modify the tool
|
| 14 |
-
"""
|
| 15 |
Args:
|
| 16 |
-
arg1:
|
| 17 |
-
arg2:
|
| 18 |
"""
|
| 19 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 20 |
|
| 21 |
@tool
|
| 22 |
def get_current_time_in_timezone(timezone: str) -> str:
|
|
|
|
| 9 |
|
| 10 |
# Below is an example of a tool that does nothing. Amaze us with your creativity !
|
| 11 |
@tool
|
| 12 |
+
def my_crypto_search_analyse_tool(arg1:str,arg2:int)-> str: #it's import to specify the return type
|
| 13 |
#Keep this format for the description / args / args description but feel free to modify the tool
|
| 14 |
+
""" Search Tool for Cryptocurency and price for n months prediction
|
| 15 |
Args:
|
| 16 |
+
arg1: crypto currency token name (eg. BTC)
|
| 17 |
+
arg2: predition months (eg. 3 means 3 months)
|
| 18 |
"""
|
| 19 |
+
search_tool = DuckDuckGoSearchTool()
|
| 20 |
+
|
| 21 |
+
#search info
|
| 22 |
+
|
| 23 |
+
query1 = f"Search on the web and write overview about {arg1} cryptocurrency"
|
| 24 |
+
result1 = search_tool.run(query1)
|
| 25 |
+
|
| 26 |
+
query2 = f"Analyse {arg1} price prediction for next {arg2} months"
|
| 27 |
+
result1 = search_tool.run(query1)
|
| 28 |
+
|
| 29 |
+
combined_result = (
|
| 30 |
+
f"📈 Current Overview of {arg1}:\n{result1}\n\n"
|
| 31 |
+
f"🔮 Price Forecast for {arg2} months:\n{result2}"
|
| 32 |
+
)
|
| 33 |
+
return combined_result
|
| 34 |
|
| 35 |
@tool
|
| 36 |
def get_current_time_in_timezone(timezone: str) -> str:
|