From 8a601877d86ad8ea38f469312783ece431e5952b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=81=8D=E5=85=AE=E6=83=9A=E5=85=AE?= <101191390+HIllya51@users.noreply.github.com> Date: Wed, 18 Sep 2024 12:07:26 +0800 Subject: [PATCH] ... --- LunaTranslator/LunaTranslator/translator/gptcommon.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LunaTranslator/LunaTranslator/translator/gptcommon.py b/LunaTranslator/LunaTranslator/translator/gptcommon.py index 517ccf84..68f1a346 100644 --- a/LunaTranslator/LunaTranslator/translator/gptcommon.py +++ b/LunaTranslator/LunaTranslator/translator/gptcommon.py @@ -79,7 +79,7 @@ class gptcommon(basetrans): try: json_data = json.loads(response_data) - msg = json_data["choices"][0]["delta"].get("content", None) + msg = json_data["choices"][0].get("delta", {}).get("content", None) if not msg: continue message += msg