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

XFEstudio/gpt4free

Update PuterJS.py

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

代码差异

1 个文件 +8 -6
Modified g4f/Provider/PuterJS.py +8 -6
@@ -424,14 +424,16 @@ class PuterJS(AsyncGeneratorProvider, ProviderModelMixin):
424 424 result = await response.json()
425 425 if "choices" in result:
426 426 choice = result["choices"][0]
427 message = choice.get("message", {})
428 content = message.get("content", "")
429 if content:
430 yield content
431 if "tool_calls" in message:
432 yield ToolCalls(message["tool_calls"])
427 elif "result" in result:
428 choice = result
433 429 else:
434 430 raise ResponseError(result)
431 message = choice.get("message", {})
432 content = message.get("content", "")
433 if content:
434 yield content
435 if "tool_calls" in message:
436 yield ToolCalls(message["tool_calls"])
435 437 if result.get("usage") is not None:
436 438 yield Usage(**result["usage"])
437 439 finish_reason = choice.get("finish_reason")