pratikshahp commited on
Commit
fd36045
·
verified ·
1 Parent(s): bac4727

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -20,7 +20,8 @@ def query_openai(question, model="gpt-4o-mini"):
20
  {"role": "user", "content": question}
21
  ]
22
  )
23
- return response.choices[0].message['content']
 
24
  except Exception as e:
25
  return f"Error: {e}"
26
 
 
20
  {"role": "user", "content": question}
21
  ]
22
  )
23
+ # Correct way to access message content
24
+ return response.choices[0].message.content
25
  except Exception as e:
26
  return f"Error: {e}"
27