Update app.py
Browse files
app.py
CHANGED
@@ -118,6 +118,12 @@ def chat_gpt_ep(content: Text = None):
|
|
118 |
"messages": obj['messages']
|
119 |
}
|
120 |
print("data = \n", data)
|
|
|
|
|
|
|
|
|
|
|
|
|
121 |
result = requests.post(url=url,
|
122 |
data=json.dumps(data),
|
123 |
headers=headers
|
|
|
118 |
"messages": obj['messages']
|
119 |
}
|
120 |
print("data = \n", data)
|
121 |
+
key = obj['key']
|
122 |
+
openai.api_key = key
|
123 |
+
headers = {
|
124 |
+
'Content-Type': 'application/json',
|
125 |
+
'Authorization': 'Bearer ' + key
|
126 |
+
}
|
127 |
result = requests.post(url=url,
|
128 |
data=json.dumps(data),
|
129 |
headers=headers
|