diff --git a/ollama/_types.py b/ollama/_types.py index 0df0ddbf..bafae9f9 100644 --- a/ollama/_types.py +++ b/ollama/_types.py @@ -313,7 +313,7 @@ class Parameters(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 properties: Optional[Mapping[str, Property]] = None diff --git a/tests/test_client.py b/tests/test_client.py index ca29806d..2130eb39 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -1139,7 +1139,7 @@ def func2(y: str) -> int: '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'], }, },