summaryrefslogtreecommitdiffstats
path: root/g4f/Provider/Bing.py
diff options
context:
space:
mode:
authorH Lohaus <hlohaus@users.noreply.github.com>2024-05-05 23:51:40 +0200
committerGitHub <noreply@github.com>2024-05-05 23:51:40 +0200
commit1d02a06456f2a05bd88782949ba28c9244fa1e6a (patch)
tree7d2505b4220f7b83adfa5cb81f076ed779176067 /g4f/Provider/Bing.py
parentMerge pull request #1923 from Hydra566/patch-2 (diff)
parentAdd Ollama provider, Add vision support to Openai (diff)
downloadgpt4free-1d02a06456f2a05bd88782949ba28c9244fa1e6a.tar
gpt4free-1d02a06456f2a05bd88782949ba28c9244fa1e6a.tar.gz
gpt4free-1d02a06456f2a05bd88782949ba28c9244fa1e6a.tar.bz2
gpt4free-1d02a06456f2a05bd88782949ba28c9244fa1e6a.tar.lz
gpt4free-1d02a06456f2a05bd88782949ba28c9244fa1e6a.tar.xz
gpt4free-1d02a06456f2a05bd88782949ba28c9244fa1e6a.tar.zst
gpt4free-1d02a06456f2a05bd88782949ba28c9244fa1e6a.zip
Diffstat (limited to 'g4f/Provider/Bing.py')
-rw-r--r--g4f/Provider/Bing.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/g4f/Provider/Bing.py b/g4f/Provider/Bing.py
index a9eb78e6..7e64a617 100644
--- a/g4f/Provider/Bing.py
+++ b/g4f/Provider/Bing.py
@@ -457,10 +457,13 @@ async def stream_generate(
returned_text = ''
message_id = None
while do_read:
- msg = await wss.receive_str()
+ try:
+ msg = await wss.receive_str()
+ except TypeError:
+ continue
objects = msg.split(Defaults.delimiter)
for obj in objects:
- if obj is None or not obj:
+ if not obj:
continue
try:
response = json.loads(obj)