mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-07 08:26:10 +00:00
fix(fireworks_ai): keep generic capability fallback for reasoning and tool_choice
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This commit is contained in:
parent
788efea7b3
commit
2f1da035ae
2 changed files with 18 additions and 5 deletions
|
|
@ -32,6 +32,7 @@ from litellm.utils import (
|
|||
get_model_cost_mutation_generation,
|
||||
supports_function_calling,
|
||||
supports_reasoning,
|
||||
supports_tool_choice,
|
||||
)
|
||||
|
||||
from ...openai.chat.gpt_transformation import (
|
||||
|
|
@ -271,11 +272,15 @@ class FireworksAIConfig(FireworksAIMixin, OpenAIGPTConfig):
|
|||
)
|
||||
|
||||
# Only add tool_choice for models that explicitly support it
|
||||
if self._get_model_cost_capability_exact(model=model, capability="supports_tool_choice"):
|
||||
if self._get_model_cost_capability_exact(
|
||||
model=model, capability="supports_tool_choice"
|
||||
) or supports_tool_choice(model=model, custom_llm_provider="fireworks_ai"):
|
||||
supported_params.append("tool_choice")
|
||||
|
||||
# Only add reasoning params for models that support it
|
||||
if self._get_model_cost_capability_exact(model=model, capability="supports_reasoning"):
|
||||
if self._get_model_cost_capability_exact(
|
||||
model=model, capability="supports_reasoning"
|
||||
) or supports_reasoning(model=model, custom_llm_provider="fireworks_ai"):
|
||||
supported_params.append("reasoning_effort")
|
||||
supported_params.append("reasoning_history")
|
||||
supported_params.append("thinking")
|
||||
|
|
|
|||
|
|
@ -4,11 +4,9 @@ from unittest.mock import MagicMock, patch
|
|||
import pytest
|
||||
|
||||
import litellm
|
||||
|
||||
|
||||
from litellm import get_model_info, supports_reasoning, supports_vision
|
||||
from litellm.llms.fireworks_ai.chat.transformation import FireworksAIConfig
|
||||
from litellm.constants import SESSION_ID_GENERATED_METADATA_KEY
|
||||
from litellm.llms.fireworks_ai.chat.transformation import FireworksAIConfig
|
||||
from litellm.llms.fireworks_ai.common_utils import get_fireworks_session_id
|
||||
from litellm.types.utils import (
|
||||
ChatCompletionMessageToolCall,
|
||||
|
|
@ -374,6 +372,16 @@ def test_get_supported_openai_params_short_model_name_resolves_account_prefixed_
|
|||
assert "reasoning_effort" in supported_params
|
||||
|
||||
|
||||
def test_get_supported_openai_params_preserves_generic_reasoning_fallback():
|
||||
config = FireworksAIConfig()
|
||||
|
||||
supported_params = config.get_supported_openai_params(
|
||||
"fireworks_ai/accounts/fireworks/models/glm-5p3-flash"
|
||||
)
|
||||
|
||||
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