mirror of
https://github.com/BerriAI/litellm.git
synced 2026-10-07 02:59:05 +00:00
fix(fireworks_ai): resolve tool_choice/reasoning support for short model names
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
2e734004f9
commit
788efea7b3
2 changed files with 13 additions and 3 deletions
|
|
@ -32,7 +32,6 @@ from litellm.utils import (
|
|||
get_model_cost_mutation_generation,
|
||||
supports_function_calling,
|
||||
supports_reasoning,
|
||||
supports_tool_choice,
|
||||
)
|
||||
|
||||
from ...openai.chat.gpt_transformation import (
|
||||
|
|
@ -272,11 +271,11 @@ class FireworksAIConfig(FireworksAIMixin, OpenAIGPTConfig):
|
|||
)
|
||||
|
||||
# Only add tool_choice for models that explicitly support it
|
||||
if supports_tool_choice(model=model, custom_llm_provider="fireworks_ai"):
|
||||
if self._get_model_cost_capability_exact(model=model, capability="supports_tool_choice"):
|
||||
supported_params.append("tool_choice")
|
||||
|
||||
# Only add reasoning params for models that support it
|
||||
if supports_reasoning(model=model, custom_llm_provider="fireworks_ai"):
|
||||
if self._get_model_cost_capability_exact(model=model, capability="supports_reasoning"):
|
||||
supported_params.append("reasoning_effort")
|
||||
supported_params.append("reasoning_history")
|
||||
supported_params.append("thinking")
|
||||
|
|
|
|||
|
|
@ -363,6 +363,17 @@ def test_get_supported_openai_params_parallel_tool_calls():
|
|||
assert "parallel_tool_calls" not in unsupported_params
|
||||
|
||||
|
||||
def test_get_supported_openai_params_short_model_name_resolves_account_prefixed_entry():
|
||||
config = FireworksAIConfig()
|
||||
|
||||
supported_params = config.get_supported_openai_params(
|
||||
"fireworks_ai/deepseek-v4-pro-0813"
|
||||
)
|
||||
|
||||
assert "tool_choice" in supported_params
|
||||
assert "reasoning_effort" in supported_params
|
||||
|
||||
|
||||
def test_get_supported_openai_params_parallel_tool_calls_without_tool_choice(
|
||||
monkeypatch,
|
||||
):
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue