-
Notifications
You must be signed in to change notification settings - Fork 178
Refactor pydantic 2 #465
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
Refactor pydantic 2 #465
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
This PR refactors the codebase to support Pydantic 2.x and improves handling of multimodal inputs, while adding support for new embedding models like nomic-ai/nomic-embed-text-v1.5.
- Removed legacy
convert.pyand its helper functions in favor of direct method calls on response classes - Changed image/audio input types from specific array types to
Union[str, bytes]insync_engine.pyand related files - Updated FastAPI models to require Pydantic 2.x and removed backwards compatibility layer
- Fixed data URI handling in
infinity_server.pyby properly accessing the 'data' attribute - Added new model integrations including nomic-ai/nomic-embed-text-v1.5 and updated Poetry requirements to 1.8.1
7 file(s) reviewed, 3 comment(s)
Edit PR Review Bot Settings | Greptile
| """the goal of this code is to write an as simple as possible server | ||
| that can we rebuild by any other p | ||
| """ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
style: incomplete docstring comment - 'p' appears to be cut off
libs/embed_package/embed/_infer.py
Outdated
| self, | ||
| *, | ||
| images: list[str], | ||
| images: Union[str, bytes], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: Type hint Union[str, bytes] doesn't match docstring example which shows a list being passed. Should be Union[list[str], list[bytes]] or similar.
libs/embed_package/embed/_infer.py
Outdated
| self, | ||
| *, | ||
| audios: list[str], | ||
| audios: Union[str, bytes], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: Type hint Union[str, bytes] doesn't match docstring example which shows a list being passed. Should be Union[list[str], list[bytes]] or similar.
|
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #465 +/- ##
==========================================
+ Coverage 79.04% 79.60% +0.56%
==========================================
Files 42 41 -1
Lines 3408 3379 -29
==========================================
- Hits 2694 2690 -4
+ Misses 714 689 -25 ☔ View full report in Codecov by Sentry. |
Related Issue
Checklist
Additional Notes
Add any other context about the PR here.