Skip to content

Commit d122ebf

Browse files
authored
Update versions (#29)
1 parent af89a67 commit d122ebf

File tree

8 files changed

+46
-46
lines changed

8 files changed

+46
-46
lines changed

.github/workflows/test-application.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
runs-on: ubuntu-latest
1515
strategy:
1616
matrix:
17-
python-version: ['3.9', '3.10', '3.11', '3.12']
17+
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
1818
steps:
1919
- uses: actions/checkout@v3
2020
- name: Set up Python ${{ matrix.python-version }}

openai_function_calling/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
__all__: list[str] = [
99
"Function",
1010
"FunctionDict",
11+
"FunctionInferrer",
12+
"JsonSchemaType",
1113
"Parameter",
1214
"ParameterDict",
13-
"JsonSchemaType",
14-
"FunctionInferrer",
1515
]

openai_function_calling/function_inferrer.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,7 @@ def _infer_from_inspection(function_reference: Callable) -> Function:
177177

178178
if parameter_type == "null":
179179
if isinstance(parameter.annotation, EnumMeta):
180-
enum_values = list(
181-
parameter.annotation._value2member_map_.keys() # noqa: SLF001
182-
)
180+
enum_values = list(parameter.annotation._value2member_map_.keys())
183181
parameter_type = FunctionInferrer._infer_list_item_type(enum_values)
184182
elif dataclasses.is_dataclass(parameter.annotation):
185183
parameter_type = JsonSchemaType.OBJECT.value

poetry.lock

Lines changed: 30 additions & 29 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ packages = [{ include = "openai_function_calling" }]
99

1010
[tool.poetry.dependencies]
1111
python = ">=3.9, <4.0"
12-
typing-extensions = "^4.7.1"
12+
typing-extensions = "^4.12.2"
1313
docstring-parser = "^0.16"
1414

1515
[tool.poetry.group.dev.dependencies]
1616
openai = "^1.3.2"
17-
pytest = "^7.4.3"
18-
ruff = "0.3.4"
19-
coverage = "^7.3.2"
17+
pytest = "^8.3.5"
18+
ruff = "0.9.9"
19+
coverage = "^7.6.12"
2020

2121
[build-system]
2222
requires = ["poetry-core"]

ruff.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ lint.fixable = [
8585
"UP",
8686
"YTT",
8787
]
88-
lint.ignore = ["D407", "D406", "D203", "ANN101", "D213", "PLR0913", "ANN401"]
88+
lint.ignore = ["D407", "D406", "D203", "D213", "PLR0913", "ANN401"]
8989
exclude = [
9090
".bzr",
9191
".direnv",

tests/test_parameter.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,12 +116,12 @@ def test_to_json_schema_with_type_array_items_returns_expected_dict() -> None:
116116

117117
parameter_dict: ParameterDict = parameter.to_json_schema()
118118

119-
assert (
120-
"items" in parameter_dict
121-
), "Expected parameter dict to have 'items' property."
122-
assert (
123-
"type" in parameter_dict["items"]
124-
), "Expected parameter 'items' dict to have 'type' property."
119+
assert "items" in parameter_dict, (
120+
"Expected parameter dict to have 'items' property."
121+
)
122+
assert "type" in parameter_dict["items"], (
123+
"Expected parameter 'items' dict to have 'type' property."
124+
)
125125
assert isinstance(parameter_dict["items"]["type"], str)
126126
assert parameter_dict["items"]["type"] == JsonSchemaType.STRING
127127

tests/test_tool_helpers.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ def test_from_functions_dicts_function_parameters_has_expected_type() -> None:
7171
[get_current_weather_schema]
7272
)[0]
7373

74+
assert "parameters" in tool_param["function"]
7475
assert isinstance(tool_param["function"]["parameters"], dict)
7576

7677

0 commit comments

Comments
 (0)