From dc1c5064ced24948ac24f05427b4b18ac28482f4 Mon Sep 17 00:00:00 2001 From: Justin McReynolds Date: Tue, 29 Oct 2024 13:10:15 -0700 Subject: [PATCH] Fix for handling OpenAI ChatCompletionMessage --- app.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app.py b/app.py index d359f62..7ac0bd1 100644 --- a/app.py +++ b/app.py @@ -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():