forked from i-am-bee/beeai-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadvanced.py
More file actions
25 lines (20 loc) · 646 Bytes
/
Copy pathadvanced.py
File metadata and controls
25 lines (20 loc) · 646 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import asyncio
import sys
import traceback
from datetime import date
from beeai_framework.errors import FrameworkError
from beeai_framework.tools.weather import OpenMeteoTool, OpenMeteoToolInput
async def main() -> None:
tool = OpenMeteoTool()
result = await tool.run(
input=OpenMeteoToolInput(
location_name="New York", start_date=date(2025, 1, 1), end_date=date(2025, 1, 2), temperature_unit="celsius"
)
)
print(result.get_text_content())
if __name__ == "__main__":
try:
asyncio.run(main())
except FrameworkError as e:
traceback.print_exc()
sys.exit(e.explain())