summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTekky <98614666+xtekky@users.noreply.github.com>2023-10-12 15:26:48 +0200
committerGitHub <noreply@github.com>2023-10-12 15:26:48 +0200
commit2ea62781fef51251c61f9b204d102baf3a3cf760 (patch)
tree894ebb7f496d864d9989077e499b5bdf44183f85
parent~ | Merge pull request #1050 from malivinayak/main (diff)
parentFix: GptGo json.decoder.JSONDecodeError (diff)
downloadgpt4free-2ea62781fef51251c61f9b204d102baf3a3cf760.tar
gpt4free-2ea62781fef51251c61f9b204d102baf3a3cf760.tar.gz
gpt4free-2ea62781fef51251c61f9b204d102baf3a3cf760.tar.bz2
gpt4free-2ea62781fef51251c61f9b204d102baf3a3cf760.tar.lz
gpt4free-2ea62781fef51251c61f9b204d102baf3a3cf760.tar.xz
gpt4free-2ea62781fef51251c61f9b204d102baf3a3cf760.tar.zst
gpt4free-2ea62781fef51251c61f9b204d102baf3a3cf760.zip
-rw-r--r--g4f/Provider/GptGo.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/g4f/Provider/GptGo.py b/g4f/Provider/GptGo.py
index f9b94a5c..255c0ca9 100644
--- a/g4f/Provider/GptGo.py
+++ b/g4f/Provider/GptGo.py
@@ -60,6 +60,8 @@ class GptGo(AsyncGeneratorProvider):
if line.startswith("data: [DONE]"):
break
line = json.loads(line[len(start):-1])
+ if line["choices"][0]["finish_reason"] == "stop":
+ break
content = line["choices"][0]["delta"].get("content")
if content:
yield content