Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,6 +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
|
|
@@ -18,6 +19,13 @@ def add_two_nums(arg1:int, arg2:int)-> int: #it's import to specify the return t
|
|
| 18 |
"""
|
| 19 |
return arg1+arg2
|
| 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 +63,7 @@ with open("prompts.yaml", 'r') as stream:
|
|
| 55 |
|
| 56 |
agent = CodeAgent(
|
| 57 |
model=model,
|
| 58 |
-
tools=[final_answer, add_two_nums, get_current_time_in_timezone], ## add your tools here (don't remove final answer)
|
| 59 |
max_steps=6,
|
| 60 |
verbosity_level=1,
|
| 61 |
grammar=None,
|
|
|
|
| 3 |
import requests
|
| 4 |
import pytz
|
| 5 |
import yaml
|
| 6 |
+
import random
|
| 7 |
from tools.final_answer import FinalAnswerTool
|
| 8 |
|
| 9 |
from Gradio_UI import GradioUI
|
|
|
|
| 19 |
"""
|
| 20 |
return arg1+arg2
|
| 21 |
|
| 22 |
+
def get_current_location():
|
| 23 |
+
"""
|
| 24 |
+
Gets the current location of where I am
|
| 25 |
+
"""
|
| 26 |
+
locations = ["New York", "Austin", "San Fransisco"]
|
| 27 |
+
return random.choice(input_list)
|
| 28 |
+
|
| 29 |
@tool
|
| 30 |
def get_current_time_in_timezone(timezone: str) -> str:
|
| 31 |
"""A tool that fetches the current local time in a specified timezone.
|
|
|
|
| 63 |
|
| 64 |
agent = CodeAgent(
|
| 65 |
model=model,
|
| 66 |
+
tools=[final_answer, add_two_nums, get_current_time_in_timezone, get_current_location], ## add your tools here (don't remove final answer)
|
| 67 |
max_steps=6,
|
| 68 |
verbosity_level=1,
|
| 69 |
grammar=None,
|