add dotenv
Browse files
app.py
CHANGED
@@ -4,10 +4,20 @@ import requests
|
|
4 |
import pytz
|
5 |
import yaml
|
6 |
from tools.final_answer import FinalAnswerTool
|
|
|
7 |
|
8 |
from Gradio_UI import GradioUI
|
9 |
|
10 |
# Below is an example of a tool that does nothing. Amaze us with your creativity !
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11 |
@tool
|
12 |
def my_custom_tool(arg1:str, arg2:int)-> str: #it's import to specify the return type
|
13 |
#Keep this format for the description / args / args description but feel free to modify the tool
|
|
|
4 |
import pytz
|
5 |
import yaml
|
6 |
from tools.final_answer import FinalAnswerTool
|
7 |
+
import os
|
8 |
|
9 |
from Gradio_UI import GradioUI
|
10 |
|
11 |
# Below is an example of a tool that does nothing. Amaze us with your creativity !
|
12 |
+
# ok my tool gets weather for $city
|
13 |
+
from dotenv import load_dotenv
|
14 |
+
import os
|
15 |
+
|
16 |
+
# Load environment variables from .env file
|
17 |
+
load_dotenv()
|
18 |
+
|
19 |
+
# Access environment variables
|
20 |
+
api_key = os.getenv("WEATHER_APIKEY")
|
21 |
@tool
|
22 |
def my_custom_tool(arg1:str, arg2:int)-> str: #it's import to specify the return type
|
23 |
#Keep this format for the description / args / args description but feel free to modify the tool
|