fix: patch grok-3 and grok-3-fast (skip reasoners for now) (#1703)

This commit is contained in:
Charles Packer
2025-04-14 12:55:20 -07:00
committed by GitHub
parent b82a19a195
commit 90f138c829
3 changed files with 19 additions and 60 deletions

View File

@@ -247,6 +247,13 @@ def create(
use_structured_output=False, # NOTE: not supported atm for xAI
)
# Specific bug for the mini models (as of Apr 14, 2025)
# 400 - {'code': 'Client specified an invalid argument', 'error': 'Argument not supported on this model: presencePenalty'}
# 400 - {'code': 'Client specified an invalid argument', 'error': 'Argument not supported on this model: frequencyPenalty'}
if "grok-3-mini-" in llm_config.model:
data.presence_penalty = None
data.frequency_penalty = None
if stream: # Client requested token streaming
data.stream = True
assert isinstance(stream_interface, AgentChunkStreamingInterface) or isinstance(