The fastest, litest AI Gateway. Rust core with Python SDK. Call 100+ LLM APIs in OpenAI (or native) format with cost tracking, guardrails, load balancing, and logging [Bedrock, Azure, OpenAI, Anthropic, OpenAI, VertexAI, vLLM, Nvidia NIM]
Python ai-gatewayanthropicazure-openaibedrockgatewaylangchainlitellmllmllm-gatewayllmopsmcp-gatewayopenaiopenai-proxyrustrust-aivertex-ai
fix(fireworks_ai): flatten dict-form reasoning_effort to its effort string
Devin AIa7a61db78dcd
diff --git a/litellm/llms/fireworks_ai/chat/transformation.py b/litellm/llms/fireworks_ai/chat/transformation.pyindex 05160d83c12..54a122f7beb 100644--- a/litellm/llms/fireworks_ai/chat/transformation.py+++ b/litellm/llms/fireworks_ai/chat/transformation.py@@ -327,12 +327,13 @@ class FireworksAIConfig(FireworksAIMixin, OpenAIGPTConfig):elif param == "max_completion_tokens":optional_params["max_tokens"] = valueelif param == "reasoning_effort":- if value is True:+ effort: Final = value.get("effort") if isinstance(value, dict) else value+ if effort is True:optional_params["reasoning_effort"] = "medium"- elif value is False:+ elif effort is False:optional_params["reasoning_effort"] = "none"- elif value != "auto":- optional_params["reasoning_effort"] = value+ elif effort is not None and effort != "auto":+ optional_params["reasoning_effort"] = effortelif param in supported_openai_params:if value is not None:optional_params[param] = valuediff --git a/tests/test_litellm/llms/fireworks_ai/chat/test_fireworks_ai_chat_transformation.py b/tests/test_litellm/llms/fireworks_ai/chat/test_fireworks_ai_chat_transformation.pyindex fb0311ef39b..7715e7b32ff 100644--- a/tests/test_litellm/llms/fireworks_ai/chat/test_fireworks_ai_chat_transformation.py+++ b/tests/test_litellm/llms/fireworks_ai/chat/test_fireworks_ai_chat_transformation.py@@ -1189,6 +1189,28 @@ def test_reasoning_effort_integer_passthrough():assert isinstance(result["reasoning_effort"], int)+def test_reasoning_effort_dict_from_anthropic_adapter_flattened_to_effort_string():+ config = FireworksAIConfig()+ result = config.map_openai_params(+ {"reasoning_effort": {"effort": "medium", "summary": "detailed"}},+ {},+ _REASONING_MODEL,+ drop_params=False,+ )+ assert result["reasoning_effort"] == "medium"+++def test_reasoning_effort_dict_without_effort_key_dropped():+ config = FireworksAIConfig()+ result = config.map_openai_params(+ {"reasoning_effort": {"summary": "detailed"}},+ {},+ _REASONING_MODEL,+ drop_params=False,+ )+ assert "reasoning_effort" not in result++def test_reasoning_effort_auto_dropped_to_model_default():config = FireworksAIConfig()result = config.map_openai_params(