返回提交历史
Modified
g4f/Provider/PuterJS.py
+8
-6
XFEstudio/gpt4free
Update PuterJS.py
49fb93e9
代码差异
1 个文件
+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")