Add self-referencing properties field to Tool.Property
Author: LinNan1Created Sep 4, 2026Updated Sep 4, 2026
The Property class currently lacks a properties field, so it cannot represent nested object schemas.
File: ollama/_types.py
Change: Add a properties field to the Property class to enable recursive nesting.
class Property(SubscriptableBaseModel):
model_config = ConfigDict(arbitrary_types_allowed=True)
type: Optional[Union[str, Sequence[str]]] = None
items: Optional[Any] = None
description: Optional[str] = None
enum: Optional[Sequence[Any]] = None
+ properties: Optional[Mapping[str, 'Property']] = None
properties: Optional[Mapping[str, Property]] = None
This enables arbitrary-depth nesting using Pydantic's forward reference. No breaking changes.
Source: ollama/ollama-python