types: relax enum type for tool (#498)

This commit is contained in:
Parth Sareen 2025-04-08 15:05:46 -07:00 committed by GitHub
parent 3eaa83781d
commit 1b3406887d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 2 deletions

View File

@ -315,6 +315,7 @@ class Tool(SubscriptableBaseModel):
type: Optional[str] = None
description: Optional[str] = None
enum: Optional[Sequence] = None
properties: Optional[Mapping[str, Property]] = None

View File

@ -200,8 +200,8 @@ def test_function_with_only_description():
assert tool['function']['parameters'] == {
'type': 'object',
'properties': {
'x': {'type': 'integer', 'description': ''},
'y': {'type': 'integer', 'description': ''},
'x': {'type': 'integer', 'description': '', 'enum': None},
'y': {'type': 'integer', 'description': '', 'enum': None},
},
'required': ['x', 'y'],
}