XFE Git
XFE Studio Git
Git 首页 全局搜索
XFE 主站 文档 NuGet
公开
关注 0 Fork 0 Star 1
返回提交历史

XFEstudio/gpt4free

Update PollinationsAI.py

a2f609b5
H Lohaus <hlohaus@users.noreply.github.com>
提交于

代码差异

1 个文件 +3 -2
Modified g4f/Provider/PollinationsAI.py +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