Skip to content

Commit

Permalink
Make fn_calling tests optional
Browse files Browse the repository at this point in the history
  • Loading branch information
piercefreeman committed Aug 24, 2023
1 parent bc9cd1f commit 680052f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
7 changes: 7 additions & 0 deletions gpt_json/tests/test_fn_calling.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -11,6 +12,9 @@
)


@pytest.mark.skipif(
get_pydantic_version() < 2, reason="Pydantic 2+ required for function calls"
)
@pytest.mark.parametrize(
"incorrect_fn",
[
Expand All @@ -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.
Expand Down

0 comments on commit 680052f

Please sign in to comment.