souljoy commited on
Commit
63137a5
1 Parent(s): d634ab6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -0
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