Skip to content

Commit 1b34068

Browse files
authored
types: relax enum type for tool (#498)
1 parent 3eaa837 commit 1b34068

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

ollama/_types.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,7 @@ class Property(SubscriptableBaseModel):
315315

316316
type: Optional[str] = None
317317
description: Optional[str] = None
318+
enum: Optional[Sequence] = None
318319

319320
properties: Optional[Mapping[str, Property]] = None
320321

tests/test_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,8 @@ def only_description_with_args(x: int, y: int):
200200
assert tool['function']['parameters'] == {
201201
'type': 'object',
202202
'properties': {
203-
'x': {'type': 'integer', 'description': ''},
204-
'y': {'type': 'integer', 'description': ''},
203+
'x': {'type': 'integer', 'description': '', 'enum': None},
204+
'y': {'type': 'integer', 'description': '', 'enum': None},
205205
},
206206
'required': ['x', 'y'],
207207
}

0 commit comments

Comments
 (0)