Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add pydantic for validation and serialization #276

Merged
merged 3 commits into from
Nov 8, 2024
Merged

add pydantic for validation and serialization #276

merged 3 commits into from
Nov 8, 2024

Conversation

mxyng
Copy link
Collaborator

@mxyng mxyng commented Sep 10, 2024

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

@mxyng mxyng changed the base branch from main to mxyng/tests September 10, 2024 22:29
Base automatically changed from mxyng/tests to main September 18, 2024 19:35
@ParthSareen
Copy link
Contributor

See #311 for pydantic type class fixes and serialization

Copy link
Contributor

@ParthSareen ParthSareen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Woooo Pydantic!!! 🥳 🎉

'Content-Type': 'application/json',
'Accept': 'application/json',
'User-Agent': f'ollama-python/{__version__} ({platform.machine()} {platform.system().lower()}) Python/{platform.python_version()}',
}.update(headers or {}),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.update() is going to return a None which means no headers will get passed in

Copy link
Contributor

@ParthSareen ParthSareen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🫡

ParthSareen and others added 2 commits November 8, 2024 10:02
* Added SubscriptableBaseModel to the Model classes and added Image codec test

---------

Co-authored-by: Parth Sareen <parth@Parths-MacBook-Pro.local>
* Fixing empty header + ensuring security
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants