diff --git a/README.md b/README.md index 444a3f4..f154aac 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ Specifically this library: - Includes retry logic for the most common API failures - Formats the JSON schema as a flexible prompt that can be added into any message - Supports templating of prompts to allow for dynamic content -- Enables typehinted function calls within the new GPT models, to better support agent creation +- Validate typehinted function calls in the new GPT models, to better support agent creation ## Getting Started diff --git a/gpt_json/tests/test_fn_calling.py b/gpt_json/tests/test_fn_calling.py index 2840704..7675958 100644 --- a/gpt_json/tests/test_fn_calling.py +++ b/gpt_json/tests/test_fn_calling.py @@ -2,6 +2,7 @@ import pytest +from gpt_json.common import get_pydantic_version from gpt_json.fn_calling import get_base_type, parse_function from gpt_json.tests.shared import ( UnitType, @@ -11,6 +12,9 @@ ) +@pytest.mark.skipif( + get_pydantic_version() < 2, reason="Pydantic 2+ required for function calls" +) @pytest.mark.parametrize( "incorrect_fn", [ @@ -29,6 +33,9 @@ def test_get_base_type(): assert get_base_type(Union[UnitType, None]) == UnitType +@pytest.mark.skipif( + get_pydantic_version() < 2, reason="Pydantic 2+ required for function calls" +) def test_parse_function(): """ Assert the formatted schema conforms to the expected JSON-Schema / GPT format.