mirror of
https://github.com/ollama/ollama-python.git
synced 2026-05-01 11:48:17 +08:00
types: relax enum type for tool (#498)
This commit is contained in:
parent
3eaa83781d
commit
1b3406887d
@ -315,6 +315,7 @@ class Tool(SubscriptableBaseModel):
|
|||||||
|
|
||||||
type: Optional[str] = None
|
type: Optional[str] = None
|
||||||
description: Optional[str] = None
|
description: Optional[str] = None
|
||||||
|
enum: Optional[Sequence] = None
|
||||||
|
|
||||||
properties: Optional[Mapping[str, Property]] = None
|
properties: Optional[Mapping[str, Property]] = None
|
||||||
|
|
||||||
|
|||||||
@ -200,8 +200,8 @@ def test_function_with_only_description():
|
|||||||
assert tool['function']['parameters'] == {
|
assert tool['function']['parameters'] == {
|
||||||
'type': 'object',
|
'type': 'object',
|
||||||
'properties': {
|
'properties': {
|
||||||
'x': {'type': 'integer', 'description': ''},
|
'x': {'type': 'integer', 'description': '', 'enum': None},
|
||||||
'y': {'type': 'integer', 'description': ''},
|
'y': {'type': 'integer', 'description': '', 'enum': None},
|
||||||
},
|
},
|
||||||
'required': ['x', 'y'],
|
'required': ['x', 'y'],
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user