mirror of
https://github.com/xtekky/gpt4free.git
synced 2025-12-05 18:20:35 -08:00
Address code review: pass enable_thinking value directly, explicit skip for cluster messages
Co-authored-by: hlohaus <983577+hlohaus@users.noreply.github.com>
This commit is contained in:
parent
da4d7d118d
commit
f57663cbe8
1 changed files with 4 additions and 3 deletions
|
|
@ -84,7 +84,7 @@ class GradientNetwork(AsyncGeneratorProvider, ProviderModelMixin):
|
|||
if max_tokens is not None:
|
||||
payload["max_tokens"] = max_tokens
|
||||
if enable_thinking:
|
||||
payload["enableThinking"] = True
|
||||
payload["enableThinking"] = enable_thinking
|
||||
|
||||
async with StreamSession(headers=headers, proxy=proxy) as session:
|
||||
async with session.post(
|
||||
|
|
@ -117,8 +117,9 @@ class GradientNetwork(AsyncGeneratorProvider, ProviderModelMixin):
|
|||
# Stream complete
|
||||
break
|
||||
|
||||
# Ignore clusterInfo and blockUpdate messages
|
||||
# as they are for GPU cluster visualization only
|
||||
elif msg_type in ("clusterInfo", "blockUpdate"):
|
||||
# Skip GPU cluster visualization messages
|
||||
continue
|
||||
|
||||
except json.JSONDecodeError:
|
||||
# Skip non-JSON lines (may be partial data or empty)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue