-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Let more BaseModel
s use OpenAI strict JSON mode by defaulting to additionalProperties=False
#2419
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
e72fc42
bb922af
f460d6b
a80f546
632cdcd
5321522
ad1d7a9
a1408bc
c7cd179
9b64cec
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -387,7 +387,6 @@ def test_response_tuple(): | |
name='final_result', | ||
description='The final response which ends this conversation', | ||
parameters_json_schema={ | ||
'additionalProperties': False, | ||
'properties': { | ||
'response': { | ||
'maxItems': 2, | ||
|
@@ -637,7 +636,6 @@ class Bar(BaseModel): | |
'type': 'object', | ||
}, | ||
}, | ||
'additionalProperties': False, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We had previously been adding it in |
||
'properties': {'response': {'anyOf': [{'$ref': '#/$defs/Foo'}, {'$ref': '#/$defs/Bar'}]}}, | ||
'required': ['response'], | ||
'type': 'object', | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -387,7 +387,7 @@ def test_docstring_unknown(): | |
{ | ||
'name': 'unknown_docstring', | ||
'description': 'Unknown style docstring.', | ||
'parameters_json_schema': {'properties': {}, 'type': 'object'}, | ||
'parameters_json_schema': {'additionalProperties': {'type': 'integer'}, 'properties': {}, 'type': 'object'}, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The tool takes |
||
'outer_typed_dict_key': None, | ||
'strict': None, | ||
'kind': 'function', | ||
|
@@ -1031,6 +1031,7 @@ def my_tool(x: Annotated[Union[str, None], WithJsonSchema({'type': 'string'})] = | |
'name': 'my_tool_1', | ||
'outer_typed_dict_key': None, | ||
'parameters_json_schema': { | ||
'additionalProperties': True, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The tool takes |
||
'properties': {'x': {'default': None, 'type': 'string'}}, | ||
'type': 'object', | ||
}, | ||
|
@@ -1071,7 +1072,6 @@ def get_score(data: Data) -> int: ... # pragma: no branch | |
'name': 'get_score', | ||
'description': None, | ||
'parameters_json_schema': { | ||
'additionalProperties': False, | ||
'properties': { | ||
'a': {'description': 'The first parameter', 'type': 'integer'}, | ||
'b': {'description': 'The second parameter', 'type': 'integer'}, | ||
|
Uh oh!
There was an error while loading. Please reload this page.