Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -19,7 +19,7 @@ def my_custom_tool(arg1:str, arg2:int)-> str: #it's import to specify the return
|
|
| 19 |
return "What magic will you build ?"
|
| 20 |
|
| 21 |
|
| 22 |
-
|
| 23 |
@tool
|
| 24 |
def multiply(a: int, b: int) -> int:
|
| 25 |
"""
|
|
@@ -46,8 +46,11 @@ def get_current_time_in_timezone(timezone: str) -> str:
|
|
| 46 |
except Exception as e:
|
| 47 |
return f"Error fetching time for timezone '{timezone}': {str(e)}"
|
| 48 |
|
|
|
|
| 49 |
|
| 50 |
final_answer = FinalAnswerTool()
|
|
|
|
|
|
|
| 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,7 +71,7 @@ with open("prompts.yaml", 'r') as stream:
|
|
| 68 |
|
| 69 |
agent = CodeAgent(
|
| 70 |
model=model,
|
| 71 |
-
tools=[final_answer, multiply], ## add your tools here (don't remove final answer)
|
| 72 |
max_steps=6,
|
| 73 |
verbosity_level=1,
|
| 74 |
grammar=None,
|
|
|
|
| 19 |
return "What magic will you build ?"
|
| 20 |
|
| 21 |
|
| 22 |
+
# Create a simple tool learned on the course
|
| 23 |
@tool
|
| 24 |
def multiply(a: int, b: int) -> int:
|
| 25 |
"""
|
|
|
|
| 46 |
except Exception as e:
|
| 47 |
return f"Error fetching time for timezone '{timezone}': {str(e)}"
|
| 48 |
|
| 49 |
+
# Import tools from the smolagengts package
|
| 50 |
|
| 51 |
final_answer = FinalAnswerTool()
|
| 52 |
+
search_tool = DuckDuckGoSearchTool()
|
| 53 |
+
|
| 54 |
|
| 55 |
# 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:
|
| 56 |
# model_id='https://pflgm2locj2t89co.us-east-1.aws.endpoints.huggingface.cloud'
|
|
|
|
| 71 |
|
| 72 |
agent = CodeAgent(
|
| 73 |
model=model,
|
| 74 |
+
tools=[final_answer, multiply, search_tool, get_current_time_in_timezone], ## add your tools here (don't remove final answer)
|
| 75 |
max_steps=6,
|
| 76 |
verbosity_level=1,
|
| 77 |
grammar=None,
|