Sabbah13 commited on
Commit
35cbe60
1 Parent(s): 623c1fa

Update openai_requests.py

Browse files
Files changed (1) hide show
  1. openai_requests.py +6 -2
openai_requests.py CHANGED
@@ -24,5 +24,9 @@ def get_completion_from_openai(prompt, max_tokens = None):
24
  headers=headers,
25
  stream=False,
26
  )
27
-
28
- return response.json()['choices'][0]['message']['content']
 
 
 
 
 
24
  headers=headers,
25
  stream=False,
26
  )
27
+ try {
28
+ return response.json()['choices'][0]['message']['content']
29
+ } except {
30
+ print(response.json())
31
+ }
32
+