summaryrefslogtreecommitdiffstats
path: root/g4f/gui/server
diff options
context:
space:
mode:
authorHeiner Lohaus <hlohaus@users.noreply.github.com>2024-03-17 10:51:08 +0100
committerHeiner Lohaus <hlohaus@users.noreply.github.com>2024-03-17 10:51:08 +0100
commitb5b56f35caf584ec92e50998979aa8bc065f67d5 (patch)
treee5dc449b76ac83c350a0932dde5118d57c73d803 /g4f/gui/server
parentFix Provider not found error (diff)
downloadgpt4free-b5b56f35caf584ec92e50998979aa8bc065f67d5.tar
gpt4free-b5b56f35caf584ec92e50998979aa8bc065f67d5.tar.gz
gpt4free-b5b56f35caf584ec92e50998979aa8bc065f67d5.tar.bz2
gpt4free-b5b56f35caf584ec92e50998979aa8bc065f67d5.tar.lz
gpt4free-b5b56f35caf584ec92e50998979aa8bc065f67d5.tar.xz
gpt4free-b5b56f35caf584ec92e50998979aa8bc065f67d5.tar.zst
gpt4free-b5b56f35caf584ec92e50998979aa8bc065f67d5.zip
Diffstat (limited to 'g4f/gui/server')
-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):
"""