Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -4,9 +4,10 @@ import requests
|
|
4 |
import pytz
|
5 |
import yaml
|
6 |
from tools.final_answer import FinalAnswerTool
|
7 |
-
from organisation_tools import PlanningTool
|
8 |
from Gradio_UI import GradioUI
|
9 |
|
|
|
10 |
@tool
|
11 |
class PlanningToolWrapper:
|
12 |
"""A tool for managing and retrieving activities from a planning tool.
|
@@ -18,7 +19,7 @@ class PlanningToolWrapper:
|
|
18 |
month: The month to filter activities by.
|
19 |
year: The year to filter activities by.
|
20 |
"""
|
21 |
-
def __init__(self, filename: str = "planning_data.json"):
|
22 |
self.planning_tool = PlanningTool(filename)
|
23 |
|
24 |
def add_activity(self, activity: str, timestamp: str) -> str:
|
@@ -41,8 +42,6 @@ class PlanningToolWrapper:
|
|
41 |
"""Retrieves activities by year from the planning tool."""
|
42 |
return self.planning_tool.get_activities_by_year(year)
|
43 |
|
44 |
-
|
45 |
-
|
46 |
# Below is an example of a tool that does nothing. Amaze us with your creativity !
|
47 |
@tool
|
48 |
def simple_calculator(arg1:int, arg2:int)-> str: #it's import to specify the return type
|
|
|
4 |
import pytz
|
5 |
import yaml
|
6 |
from tools.final_answer import FinalAnswerTool
|
7 |
+
from tools.organisation_tools import PlanningTool
|
8 |
from Gradio_UI import GradioUI
|
9 |
|
10 |
+
#now make the tool with all the methods and attributes with everything from organisation_tools.py
|
11 |
@tool
|
12 |
class PlanningToolWrapper:
|
13 |
"""A tool for managing and retrieving activities from a planning tool.
|
|
|
19 |
month: The month to filter activities by.
|
20 |
year: The year to filter activities by.
|
21 |
"""
|
22 |
+
def __init__(self, filename: str = "planning_data.json") -> None:
|
23 |
self.planning_tool = PlanningTool(filename)
|
24 |
|
25 |
def add_activity(self, activity: str, timestamp: str) -> str:
|
|
|
42 |
"""Retrieves activities by year from the planning tool."""
|
43 |
return self.planning_tool.get_activities_by_year(year)
|
44 |
|
|
|
|
|
45 |
# Below is an example of a tool that does nothing. Amaze us with your creativity !
|
46 |
@tool
|
47 |
def simple_calculator(arg1:int, arg2:int)-> str: #it's import to specify the return type
|