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

XFEstudio/gpt4free

Address code review: pass enable_thinking value directly, explicit skip for cluster messages

Co-authored-by: hlohaus <983577+hlohaus@users.noreply.github.com>

f57663cb
copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
提交于

代码差异

1 个文件 +4 -3
Modified g4f/Provider/GradientNetwork.py +4 -3
@@ -84,7 +84,7 @@ class GradientNetwork(AsyncGeneratorProvider, ProviderModelMixin):
84 84 if max_tokens is not None:
85 85 payload["max_tokens"] = max_tokens
86 86 if enable_thinking:
87 payload["enableThinking"] = True
87 payload["enableThinking"] = enable_thinking
88 88
89 89 async with StreamSession(headers=headers, proxy=proxy) as session:
90 90 async with session.post(
@@ -117,8 +117,9 @@ class GradientNetwork(AsyncGeneratorProvider, ProviderModelMixin):
117 117 # Stream complete
118 118 break
119 119
120 # Ignore clusterInfo and blockUpdate messages
121 # as they are for GPU cluster visualization only
120 elif msg_type in ("clusterInfo", "blockUpdate"):
121 # Skip GPU cluster visualization messages
122 continue
122 123
123 124 except json.JSONDecodeError:
124 125 # Skip non-JSON lines (may be partial data or empty)