api keys
Browse files- app.py +1 -2
- getFlightData.py +4 -8
app.py
CHANGED
|
@@ -13,8 +13,7 @@ from langchain.memory import ConversationBufferMemory
|
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
-
os.environ["
|
| 17 |
-
|
| 18 |
|
| 19 |
today = datetime.today().strftime("%Y-%m-%d")
|
| 20 |
|
|
|
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
+
os.environ["OpenAI_key"]
|
|
|
|
| 17 |
|
| 18 |
today = datetime.today().strftime("%Y-%m-%d")
|
| 19 |
|
getFlightData.py
CHANGED
|
@@ -1,11 +1,12 @@
|
|
| 1 |
|
| 2 |
import requests
|
|
|
|
| 3 |
|
| 4 |
def getAccessToken():
|
| 5 |
url = "https://api.lufthansa.com/v1/oauth/token"
|
| 6 |
data = {
|
| 7 |
-
"client_id":
|
| 8 |
-
"client_secret":
|
| 9 |
"grant_type": "client_credentials"
|
| 10 |
}
|
| 11 |
|
|
@@ -13,12 +14,7 @@ def getAccessToken():
|
|
| 13 |
|
| 14 |
return response["access_token"]
|
| 15 |
|
| 16 |
-
|
| 17 |
-
flight = info['FlightStatusResource']['Flights']['Flight'][0]
|
| 18 |
-
departure = flight['Departure']
|
| 19 |
-
arrival = flight['Arrival']
|
| 20 |
-
marketing_carrier = flight['MarketingCarrier']
|
| 21 |
-
|
| 22 |
|
| 23 |
|
| 24 |
def getFlightInfo(flight_number, date):
|
|
|
|
| 1 |
|
| 2 |
import requests
|
| 3 |
+
import os
|
| 4 |
|
| 5 |
def getAccessToken():
|
| 6 |
url = "https://api.lufthansa.com/v1/oauth/token"
|
| 7 |
data = {
|
| 8 |
+
"client_id": os.environ['client_id'],
|
| 9 |
+
"client_secret": os.environ['client_secret'],
|
| 10 |
"grant_type": "client_credentials"
|
| 11 |
}
|
| 12 |
|
|
|
|
| 14 |
|
| 15 |
return response["access_token"]
|
| 16 |
|
| 17 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 18 |
|
| 19 |
|
| 20 |
def getFlightInfo(flight_number, date):
|