fix(llm): remove default reasoning_effort; fix Gemini special case (#11567)

This commit is contained in:
Yakshith
2025-11-05 17:30:46 -05:00
committed by GitHub
parent 6b211f3b29
commit 75e54e3552
5 changed files with 23 additions and 13 deletions

View File

@@ -62,8 +62,11 @@ class AsyncLLM(LLM):
elif 'messages' in kwargs:
messages = kwargs['messages']
# Set reasoning effort for models that support it
if get_features(self.config.model).supports_reasoning_effort:
# Set reasoning effort for models that support it, only if explicitly provided
if (
get_features(self.config.model).supports_reasoning_effort
and self.config.reasoning_effort is not None
):
kwargs['reasoning_effort'] = self.config.reasoning_effort
# ensure we work with a list of messages

View File

@@ -155,7 +155,8 @@ class LLM(RetryMixin, DebugMixin):
# don't send reasoning_effort to specific Claude Sonnet/Haiku 4.5 variants
kwargs.pop('reasoning_effort', None)
else:
kwargs['reasoning_effort'] = self.config.reasoning_effort
if self.config.reasoning_effort is not None:
kwargs['reasoning_effort'] = self.config.reasoning_effort
kwargs.pop(
'temperature'
) # temperature is not supported for reasoning models

View File

@@ -64,8 +64,11 @@ class StreamingLLM(AsyncLLM):
'The messages list is empty. At least one message is required.'
)
# Set reasoning effort for models that support it
if get_features(self.config.model).supports_reasoning_effort:
# Set reasoning effort for models that support it, only if explicitly provided
if (
get_features(self.config.model).supports_reasoning_effort
and self.config.reasoning_effort is not None
):
kwargs['reasoning_effort'] = self.config.reasoning_effort
self.log_prompt(messages)