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

XFEstudio/gpt4free

Fix error __str__ returned non-string (type list) when using reasoning model

5ddb5ac0
Juxoola <liketoeatpizza19@gmail.com>
提交于

代码差异

1 个文件 +12 -1
Modified g4f/client/__init__.py +12 -1
@@ -73,7 +73,18 @@ def iter_response(
73 73 elif isinstance(chunk, Exception):
74 74 continue
75 75
76 chunk = str(chunk)
76 if isinstance(chunk, list):
77 chunk = "".join(map(str, chunk))
78 else:
79
80 temp = chunk.__str__()
81 if not isinstance(temp, str):
82 if isinstance(temp, list):
83 temp = "".join(map(str, temp))
84 else:
85 temp = repr(chunk)
86 chunk = temp
87
77 88 content += chunk
78 89
79 90 if max_tokens is not None and idx + 1 >= max_tokens: