summaryrefslogtreecommitdiffstats
path: root/g4f/gui/server/api.py
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--g4f/gui/server/api.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/g4f/gui/server/api.py b/g4f/gui/server/api.py
index 966319e4..4dfc43d4 100644
--- a/g4f/gui/server/api.py
+++ b/g4f/gui/server/api.py
@@ -80,7 +80,8 @@ class Api():
self._prepare_conversation_kwargs(options, kwargs),
options.get("conversation_id")
):
- window.evaluate_js(f"this.add_message_chunk({json.dumps(message)})")
+ if not window.evaluate_js(f"if (!this.abort) this.add_message_chunk({json.dumps(message)}); !this.abort && !this.error;"):
+ break
def _prepare_conversation_kwargs(self, json_data: dict, kwargs: dict):
"""