Use ModelCapabilities for Grok thinking mode support check
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This commit is contained in:
@@ -148,6 +148,10 @@ class XAIModelProvider(OpenAICompatibleProvider):
|
|||||||
|
|
||||||
def supports_thinking_mode(self, model_name: str) -> bool:
|
def supports_thinking_mode(self, model_name: str) -> bool:
|
||||||
"""Check if the model supports extended thinking mode."""
|
"""Check if the model supports extended thinking mode."""
|
||||||
# Grok-4 supports extended thinking/reasoning mode
|
# Check capabilities to determine thinking mode support
|
||||||
resolved_name = self._resolve_model_name(model_name)
|
try:
|
||||||
return resolved_name == "grok-4-0709"
|
capabilities = self.get_capabilities(model_name)
|
||||||
|
return capabilities.supports_extended_thinking
|
||||||
|
except ValueError:
|
||||||
|
# If the model is not supported, it doesn't support thinking mode.
|
||||||
|
return False
|
||||||
|
|||||||
Reference in New Issue
Block a user