[PR #276] [MERGED] add pydantic for validation and serialization #446

Closed
opened 2026-02-15 16:30:26 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama-python/pull/276
Author: @mxyng
Created: 9/10/2024
Status: Merged
Merged: 11/8/2024
Merged by: @mxyng

Base: mainHead: mxyng/pydantic


📝 Commits (3)

📊 Changes

8 files changed (+1244 additions, -636 deletions)

View changed files

📝 ollama/__init__.py (+18 -16)
📝 ollama/_client.py (+512 -372)
📝 ollama/_types.py (+326 -97)
📝 poetry.lock (+161 -1)
📝 pyproject.toml (+1 -0)
📝 requirements.txt (+100 -1)
📝 tests/test_client.py (+111 -149)
tests/test_type_serialization.py (+15 -0)

📄 Description

while the interface should be backwards compatible, i.e. most tests and examples do not need any changes, this change wants a minor version bump

examples should be updated in a following change to use pydantic models where appropriate


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ollama/ollama-python/pull/276 **Author:** [@mxyng](https://github.com/mxyng) **Created:** 9/10/2024 **Status:** ✅ Merged **Merged:** 11/8/2024 **Merged by:** [@mxyng](https://github.com/mxyng) **Base:** `main` ← **Head:** `mxyng/pydantic` --- ### 📝 Commits (3) - [`0bbc246`](https://github.com/ollama/ollama-python/commit/0bbc2460076a75cebedf5de1315e7c9a70cfbb28) pydantic types - [`f258342`](https://github.com/ollama/ollama-python/commit/f25834217be31fb730c9c8d64a7a2d638d489bf5) Pydantic Fixes and Tests (#311) - [`7205218`](https://github.com/ollama/ollama-python/commit/72052188c3d0e020bdd12abb3ff9cd12a156a0bf) Fixing empty header + ensuring security (#313) ### 📊 Changes **8 files changed** (+1244 additions, -636 deletions) <details> <summary>View changed files</summary> 📝 `ollama/__init__.py` (+18 -16) 📝 `ollama/_client.py` (+512 -372) 📝 `ollama/_types.py` (+326 -97) 📝 `poetry.lock` (+161 -1) 📝 `pyproject.toml` (+1 -0) 📝 `requirements.txt` (+100 -1) 📝 `tests/test_client.py` (+111 -149) ➕ `tests/test_type_serialization.py` (+15 -0) </details> ### 📄 Description while the interface should be backwards compatible, i.e. most tests and examples do not need any changes, this change wants a minor version bump examples should be updated in a following change to use pydantic models where appropriate --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-15 16:30:26 -05:00
yindo closed this issue 2026-02-15 16:30:26 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: ollama/ollama-python#446