diff --git a/tests/unit/llms/test_llm_openai.py b/tests/unit/llms/test_llm_openai.py index 9f1b94277510e6223545e499d3e81409260a6fd2..25573bd96bcd92baac06e38fb531c27b726679a0 100644 --- a/tests/unit/llms/test_llm_openai.py +++ b/tests/unit/llms/test_llm_openai.py @@ -2,7 +2,7 @@ import pytest from semantic_router.llms import OpenAILLM from semantic_router.schema import Message -from semantic_router.utils.function_call import get_schema_openai +from semantic_router.utils.function_call import get_schema_openai, convert_param_type_to_json_type @pytest.fixture @@ -167,3 +167,15 @@ class TestOpenAILLM: assert ( expected_error_message in actual_error_message ), f"Expected error message: '{expected_error_message}', but got: '{actual_error_message}'" + + + def test_convert_param_type_to_json_type(self): + # Test conversion of basic types + assert convert_param_type_to_json_type("int") == "number" + assert convert_param_type_to_json_type("float") == "number" + assert convert_param_type_to_json_type("str") == "string" + assert convert_param_type_to_json_type("bool") == "boolean" + assert convert_param_type_to_json_type("NoneType") == "null" + assert convert_param_type_to_json_type("list") == "array" + # Test conversion of a type not explicitly handled + assert convert_param_type_to_json_type("dict") == "object" \ No newline at end of file diff --git a/tests/unit/test_route.py b/tests/unit/test_route.py index 3cedeadb998fa6632e87672752b9f6da9ddfe4c6..5b91f9d32770bf0b736eb34540dac4e8cc3c9248 100644 --- a/tests/unit/test_route.py +++ b/tests/unit/test_route.py @@ -5,7 +5,6 @@ import pytest from semantic_router.llms import BaseLLM from semantic_router.route import Route, is_valid - # Is valid test: def test_is_valid_with_valid_json(): valid_json = '{"name": "test_route", "utterances": ["hello", "hi"]}'