Themivito commited on
Commit
abce102
·
verified ·
1 Parent(s): fc4b7eb

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -2
app.py CHANGED
@@ -34,13 +34,20 @@ def generate_checklist(pdf_file):
34
  Structured Checklist:
35
  """
36
  try:
37
- response = client.chat.completions.create(
38
  model="gpt-4",
39
  messages=[{"role": "system", "content": prompt}],
40
  temperature=0.3,
41
  max_tokens=800
42
  )
43
- checklist = response.choices[0].message.content
 
 
 
 
 
 
 
44
  except Exception as e:
45
  checklist = f"Error generating checklist: {str(e)}"
46
 
 
34
  Structured Checklist:
35
  """
36
  try:
37
+ response = openai.ChatCompletion.create(
38
  model="gpt-4",
39
  messages=[{"role": "system", "content": prompt}],
40
  temperature=0.3,
41
  max_tokens=800
42
  )
43
+ checklist = response["choices"][0]["message"]["content"]
44
+ except Exception as e:
45
+
46
+ return f"Error generating checklist: {str(e)}"
47
+
48
+ return checklist
49
+
50
+
51
  except Exception as e:
52
  checklist = f"Error generating checklist: {str(e)}"
53