Add self-referencing properties field to Tool.Property
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 10.5k
- Forks
- 1.2k
- Avg merge
- 4m
- Merged PRs (30d)
- 1
Description
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.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in ollama/_types.py at the Property class around lines 372-384 and review how its existing fields are typed with Pydantic. Add the recursive properties field described in the issue, then verify that nested object schemas can be represented at arbitrary depth without breaking existing fields.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend-api-design
- Issue type
- Feature
- Difficulty
- 1/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 90/100