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 |
|
|
|
parameters: Optional[Parameters] = None |
|
|
|
function: Optional[Function] = None |
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.
The
Propertyclass currently lacks apropertiesfield, so it cannot represent nested object schemas.File:
ollama/_types.pyChange: Add a
propertiesfield to thePropertyclass to enable recursive nesting.ollama-python/ollama/_types.py
Lines 372 to 384 in fa85099
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]] = NoneThis enables arbitrary-depth nesting using Pydantic's forward reference. No breaking changes.