mirror of
https://github.com/xtekky/gpt4free.git
synced 2025-12-06 02:30:41 -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:
|
if max_tokens is not None:
|
||||||
payload["max_tokens"] = max_tokens
|
payload["max_tokens"] = max_tokens
|
||||||
if enable_thinking:
|
if enable_thinking:
|
||||||
payload["enableThinking"] = True
|
payload["enableThinking"] = enable_thinking
|
||||||
|
|
||||||
async with StreamSession(headers=headers, proxy=proxy) as session:
|
async with StreamSession(headers=headers, proxy=proxy) as session:
|
||||||
async with session.post(
|
async with session.post(
|
||||||
|
|
@ -117,8 +117,9 @@ class GradientNetwork(AsyncGeneratorProvider, ProviderModelMixin):
|
||||||
# Stream complete
|
# Stream complete
|
||||||
break
|
break
|
||||||
|
|
||||||
# Ignore clusterInfo and blockUpdate messages
|
elif msg_type in ("clusterInfo", "blockUpdate"):
|
||||||
# as they are for GPU cluster visualization only
|
# Skip GPU cluster visualization messages
|
||||||
|
continue
|
||||||
|
|
||||||
except json.JSONDecodeError:
|
except json.JSONDecodeError:
|
||||||
# Skip non-JSON lines (may be partial data or empty)
|
# Skip non-JSON lines (may be partial data or empty)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue