mirror of
https://github.com/xtekky/gpt4free.git
synced 2025-12-24 13:07:53 +08:00
Update (g4f/Provider/ChatGpt.py g4f/Provider/DarkAI.py)
This commit is contained in:
@@ -210,7 +210,6 @@ class ChatGpt(AbstractProvider, ProviderModelMixin):
|
||||
for line in response.iter_lines():
|
||||
if line:
|
||||
decoded_line = line.decode()
|
||||
print(decoded_line)
|
||||
|
||||
if decoded_line.startswith('data:'):
|
||||
json_string = decoded_line[6:].strip()
|
||||
|
||||
@@ -75,9 +75,9 @@ class DarkAI(AsyncGeneratorProvider, ProviderModelMixin):
|
||||
yield full_text.strip()
|
||||
return
|
||||
except json.JSONDecodeError:
|
||||
print(f"Failed to decode JSON: {chunk_str}")
|
||||
except Exception as e:
|
||||
print(f"Error processing chunk: {e}")
|
||||
pass
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
if full_text:
|
||||
yield full_text.strip()
|
||||
|
||||
Reference in New Issue
Block a user