Refactor pydantic 2#465
Conversation
There was a problem hiding this comment.
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.
style: incomplete docstring comment - 'p' appears to be cut off
| self, | ||
| *, | ||
| images: list[str], | ||
| images: Union[str, bytes], |
There was a problem hiding this comment.
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.
| self, | ||
| *, | ||
| audios: list[str], | ||
| audios: Union[str, bytes], |
There was a problem hiding this comment.
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.