mirror of
https://github.com/ollama/ollama-python.git
synced 2026-01-13 21:57:16 +08:00
types: allow single or multiple types tool property (#499)
Some checks failed
test / test (3.10) (push) Has been cancelled
test / test (3.11) (push) Has been cancelled
test / test (3.12) (push) Has been cancelled
test / test (3.13) (push) Has been cancelled
test / test (3.8) (push) Has been cancelled
test / test (3.9) (push) Has been cancelled
test / lint (push) Has been cancelled
Some checks failed
test / test (3.10) (push) Has been cancelled
test / test (3.11) (push) Has been cancelled
test / test (3.12) (push) Has been cancelled
test / test (3.13) (push) Has been cancelled
test / test (3.8) (push) Has been cancelled
test / test (3.9) (push) Has been cancelled
test / lint (push) Has been cancelled
This commit is contained in:
parent
1b3406887d
commit
8ac9f4da76
@ -313,7 +313,7 @@ class Tool(SubscriptableBaseModel):
|
||||
class Property(SubscriptableBaseModel):
|
||||
model_config = ConfigDict(arbitrary_types_allowed=True)
|
||||
|
||||
type: Optional[str] = None
|
||||
type: Optional[Union[str, Sequence[str]]] = None
|
||||
description: Optional[str] = None
|
||||
enum: Optional[Sequence] = None
|
||||
|
||||
|
||||
@ -1139,7 +1139,7 @@ def test_copy_tools():
|
||||
'description': 'Test function',
|
||||
'parameters': {
|
||||
'type': 'object',
|
||||
'properties': {'x': {'type': 'string', 'description': 'A string'}},
|
||||
'properties': {'x': {'type': 'string', 'description': 'A string', 'enum': ['a', 'b', 'c']}, 'y': {'type': ['integer', 'number'], 'description': 'An integer'}},
|
||||
'required': ['x'],
|
||||
},
|
||||
},
|
||||
|
||||
Loading…
Reference in New Issue
Block a user