Skip to content

Commit 8ac9f4d

Browse files
authored
types: allow single or multiple types tool property (#499)
1 parent 1b34068 commit 8ac9f4d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

ollama/_types.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ class Parameters(SubscriptableBaseModel):
313313
class Property(SubscriptableBaseModel):
314314
model_config = ConfigDict(arbitrary_types_allowed=True)
315315

316-
type: Optional[str] = None
316+
type: Optional[Union[str, Sequence[str]]] = None
317317
description: Optional[str] = None
318318
enum: Optional[Sequence] = None
319319

tests/test_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1139,7 +1139,7 @@ def func2(y: str) -> int:
11391139
'description': 'Test function',
11401140
'parameters': {
11411141
'type': 'object',
1142-
'properties': {'x': {'type': 'string', 'description': 'A string'}},
1142+
'properties': {'x': {'type': 'string', 'description': 'A string', 'enum': ['a', 'b', 'c']}, 'y': {'type': ['integer', 'number'], 'description': 'An integer'}},
11431143
'required': ['x'],
11441144
},
11451145
},

0 commit comments

Comments
 (0)