From 829dece9aa9d0fd07b4d7619f30631b616759b45 Mon Sep 17 00:00:00 2001 From: Ishaan Jaff Date: Wed, 26 Jun 2024 06:58:00 -0700 Subject: [PATCH] test - fireworks ai param mapping --- litellm/tests/test_fireworks_ai.py | 32 ++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 litellm/tests/test_fireworks_ai.py diff --git a/litellm/tests/test_fireworks_ai.py b/litellm/tests/test_fireworks_ai.py new file mode 100644 index 00000000000..c7c1f54453c --- /dev/null +++ b/litellm/tests/test_fireworks_ai.py @@ -0,0 +1,32 @@ +import os +import sys + +import pytest + +sys.path.insert( + 0, os.path.abspath("../..") +) # Adds the parent directory to the system path + +from litellm.llms.fireworks_ai import FireworksAIConfig + +fireworks = FireworksAIConfig() + + +def test_map_openai_params_tool_choice(): + # Test case 1: tool_choice is "required" + result = fireworks.map_openai_params({"tool_choice": "required"}, {}, "some_model") + assert result == {"tool_choice": "any"} + + # Test case 2: tool_choice is "auto" + result = fireworks.map_openai_params({"tool_choice": "auto"}, {}, "some_model") + assert result == {"tool_choice": "auto"} + + # Test case 3: tool_choice is not present + result = fireworks.map_openai_params( + {"some_other_param": "value"}, {}, "some_model" + ) + assert result == {} + + # Test case 4: tool_choice is None + result = fireworks.map_openai_params({"tool_choice": None}, {}, "some_model") + assert result == {"tool_choice": None}