summaryrefslogtreecommitdiffstats
path: root/g4f/gui/server
diff options
context:
space:
mode:
authorH Lohaus <hlohaus@users.noreply.github.com>2024-03-17 10:52:54 +0100
committerGitHub <noreply@github.com>2024-03-17 10:52:54 +0100
commit9536b857d67b2b9b819580eeb55c6a051454075f (patch)
tree6002f32229f616f16738c35d4b0a63d59b5ee378 /g4f/gui/server
parentUpdate GigaChat.py (diff)
parentFix abort in webview (diff)
downloadgpt4free-9536b857d67b2b9b819580eeb55c6a051454075f.tar
gpt4free-9536b857d67b2b9b819580eeb55c6a051454075f.tar.gz
gpt4free-9536b857d67b2b9b819580eeb55c6a051454075f.tar.bz2
gpt4free-9536b857d67b2b9b819580eeb55c6a051454075f.tar.lz
gpt4free-9536b857d67b2b9b819580eeb55c6a051454075f.tar.xz
gpt4free-9536b857d67b2b9b819580eeb55c6a051454075f.tar.zst
gpt4free-9536b857d67b2b9b819580eeb55c6a051454075f.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):
"""