Spaces:
Sleeping
Sleeping
Update app.py
Browse filesEdits after error
app.py
CHANGED
|
@@ -11,8 +11,8 @@ from Gradio_UI import GradioUI
|
|
| 11 |
@tool
|
| 12 |
def get_bitcoin_price() -> str:
|
| 13 |
"""A tool that fetches the current price of Bitcoin in USD.
|
| 14 |
-
|
| 15 |
-
|
| 16 |
"""
|
| 17 |
try:
|
| 18 |
url = "https://api.coingecko.com/api/v3/simple/price?ids=bitcoin&vs_currencies=usd"
|
|
@@ -43,7 +43,6 @@ def get_current_time_in_timezone(timezone: str) -> str:
|
|
| 43 |
|
| 44 |
|
| 45 |
final_answer = FinalAnswerTool()
|
| 46 |
-
bitcoin_price = get_bitcoin_price()
|
| 47 |
|
| 48 |
# 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:
|
| 49 |
# model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud'
|
|
@@ -64,7 +63,7 @@ with open("prompts.yaml", 'r') as stream:
|
|
| 64 |
|
| 65 |
agent = CodeAgent(
|
| 66 |
model=model,
|
| 67 |
-
tools=[final_answer
|
| 68 |
max_steps=6,
|
| 69 |
verbosity_level=1,
|
| 70 |
grammar=None,
|
|
|
|
| 11 |
@tool
|
| 12 |
def get_bitcoin_price() -> str:
|
| 13 |
"""A tool that fetches the current price of Bitcoin in USD.
|
| 14 |
+
Args:
|
| 15 |
+
No arguments required
|
| 16 |
"""
|
| 17 |
try:
|
| 18 |
url = "https://api.coingecko.com/api/v3/simple/price?ids=bitcoin&vs_currencies=usd"
|
|
|
|
| 43 |
|
| 44 |
|
| 45 |
final_answer = FinalAnswerTool()
|
|
|
|
| 46 |
|
| 47 |
# 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:
|
| 48 |
# model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud'
|
|
|
|
| 63 |
|
| 64 |
agent = CodeAgent(
|
| 65 |
model=model,
|
| 66 |
+
tools=[final_answer,get_bitcoin_price], ## add your tools here (don't remove final answer)
|
| 67 |
max_steps=6,
|
| 68 |
verbosity_level=1,
|
| 69 |
grammar=None,
|