Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -11,24 +11,32 @@ load_dotenv()
|
|
11 |
openai.api_key = os.getenv("OPENAI_API_KEY1")
|
12 |
|
13 |
# Define function to get current weather
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32 |
|
33 |
# Function definition and initial message handling
|
34 |
def weather_chat(user_message):
|
|
|
11 |
openai.api_key = os.getenv("OPENAI_API_KEY1")
|
12 |
|
13 |
# Define function to get current weather
|
14 |
+
{
|
15 |
+
"name": "get_weather",
|
16 |
+
"description": "Determine weather in my location",
|
17 |
+
"strict": true,
|
18 |
+
"parameters": {
|
19 |
+
"type": "object",
|
20 |
+
"properties": {
|
21 |
+
"location": {
|
22 |
+
"type": "string",
|
23 |
+
"description": "The city and state e.g. San Francisco, CA"
|
24 |
+
},
|
25 |
+
"unit": {
|
26 |
+
"type": "string",
|
27 |
+
"enum": [
|
28 |
+
"c",
|
29 |
+
"f"
|
30 |
+
]
|
31 |
+
}
|
32 |
+
},
|
33 |
+
"additionalProperties": false,
|
34 |
+
"required": [
|
35 |
+
"location",
|
36 |
+
"unit"
|
37 |
+
]
|
38 |
+
}
|
39 |
+
}
|
40 |
|
41 |
# Function definition and initial message handling
|
42 |
def weather_chat(user_message):
|