ollama / ollama/ollama-python

Add self-referencing properties field to Tool.Property

Open Beginner friendly
#724 0 comments 0 reactions 0 assignees View on GitHub

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.

https://github.com/ollama/ollama-python/blob/fa8509936be08809bd15ca90a371165eb9abeb50/ollama/_types.py#L372-L384

      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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.