Skip to content

Commit

Permalink
Fix for handling OpenAI ChatCompletionMessage
Browse files Browse the repository at this point in the history
  • Loading branch information
mcjustin committed Oct 29, 2024
1 parent 86d7974 commit dc1c506
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ def chat():
model="gpt-4o-mini-2024-07-18",
messages=data['messages']
)
# return jsonify(response.choices[0].message)
return response.choices[0].message
message_dict = response.choices[0].message.to_dict()
return jsonify(message_dict)

@app.route('/api/go', methods=['GET'])
def go():
Expand Down

0 comments on commit dc1c506

Please sign in to comment.