summaryrefslogtreecommitdiffstats
path: root/g4f
diff options
context:
space:
mode:
Diffstat (limited to 'g4f')
-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