返回提交历史
Modified
g4f/Provider/PollinationsAI.py
+3
-2
XFEstudio/gpt4free
Update PollinationsAI.py
a2f609b5
代码差异
1 个文件
+3
-2
@@ -139,7 +139,7 @@ class PollinationsAI(AsyncGeneratorProvider, ProviderModelMixin):
139
139
cls,
140
140
model: str,
141
141
messages: Messages,
142
stream: bool = False,
142
stream: bool = True,
143
143
proxy: str = None,
144
144
cache: bool = False,
145
145
# Image generation parameters
@@ -311,7 +311,8 @@ class PollinationsAI(AsyncGeneratorProvider, ProviderModelMixin):
311
311
if line[6:].startswith(b"[DONE]"):
312
312
break
313
313
result = json.loads(line[6:])
314
choice = result.get("choices", [{}])[0]
314
choices = result.get("choices", [{}])
315
choice = choices.pop() if choices else {}
315
316
content = choice.get("delta", {}).get("content")
316
317
if content:
317
318
yield content