-
Notifications
You must be signed in to change notification settings - Fork 120
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 client packages #382
add client packages #382
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## main #382 +/- ##
=======================================
Coverage 77.78% 77.78%
=======================================
Files 37 37
Lines 2804 2804
=======================================
Hits 2181 2181
Misses 623 623 ☔ View full report in Codecov by Sentry. |
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 introduces audio embedding support and enhances encoding formats for embeddings in the Infinity client packages.
- Added
libs/client_infinity/infinity_client/infinity_client/api/default/embeddings_audio.py
for audio embedding API endpoint - Introduced
AudioEmbeddingInput
class inlibs/client_infinity/infinity_client/infinity_client/models/audio_embedding_input.py
for handling audio embedding requests - Created
EmbeddingEncodingFormat
enum inlibs/client_infinity/infinity_client/infinity_client/models/embedding_encoding_format.py
to define BASE64 and FLOAT encoding formats - Updated
EmbeddingObject
class inembedding_object.py
to support both List[float] and File types for embeddings - Modified
libs/embed_package/pyproject.toml
to use a specific version (0.0.58) of infinity_emb instead of a local path
13 file(s) reviewed, 11 comment(s)
Edit PR Review Bot Settings
requests.post(\"http://..:7997/embeddings_audio\", | ||
json={\"model\":\"laion/larger_clap_general\",\"input\":[\"https://github.com/michaelfeil/infini | ||
ty/raw/3b72eb7c14bae06e68ddd07c1f23fe0bf403f220/libs/infinity_emb/tests/data/audio/beep.wav\"]}) |
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: URL in example is incomplete. Consider using a placeholder or full example URL
requests.post(\"http://..:7997/embeddings_audio\", | ||
json={\"model\":\"laion/larger_clap_general\",\"input\":[\"https://github.com/michaelfeil/infini | ||
ty/raw/3b72eb7c14bae06e68ddd07c1f23fe0bf403f220/libs/infinity_emb/tests/data/audio/beep.wav\"]}) |
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: Duplicate code from sync_detailed function. Consider refactoring to avoid repetition
requests.post(\"http://..:7997/embeddings_audio\", | ||
json={\"model\":\"laion/larger_clap_general\",\"input\":[\"https://github.com/michaelfeil/infini | ||
ty/raw/3b72eb7c14bae06e68ddd07c1f23fe0bf403f220/libs/infinity_emb/tests/data/audio/beep.wav\"]}) |
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: Duplicate code from sync_detailed function. Consider refactoring to avoid repetition
requests.post(\"http://..:7997/embeddings_audio\", | ||
json={\"model\":\"laion/larger_clap_general\",\"input\":[\"https://github.com/michaelfeil/infini | ||
ty/raw/3b72eb7c14bae06e68ddd07c1f23fe0bf403f220/libs/infinity_emb/tests/data/audio/beep.wav\"]}) |
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: Duplicate code from sync_detailed function. Consider refactoring to avoid repetition
libs/client_infinity/infinity_client/infinity_client/models/audio_embedding_input.py
Show resolved
Hide resolved
embedding_type_0 = cast(List[float], data) | ||
|
||
return embedding_type_0 | ||
except: # noqa: E722 |
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: Avoid bare except clauses. Catch specific exceptions or at least use except Exception:
.
index (int): | ||
object_ (Union[Unset, EmbeddingObjectObject]): Default: EmbeddingObjectObject.EMBEDDING. | ||
""" | ||
|
||
embedding: List[float] | ||
embedding: Union[File, List[float]] |
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: Update the docstring to reflect the new Union[File, List[float]] type for embedding.
@@ -14,11 +15,13 @@ class ImageEmbeddingInput: | |||
Attributes: | |||
input_ (Union[List[str], str]): |
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: Consider updating the docstring to include a description of the encoding_format
attribute
@@ -14,11 +15,13 @@ class ImageEmbeddingInput: | |||
Attributes: | |||
input_ (Union[List[str], str]): | |||
model (Union[Unset, str]): Default: 'default/not-specified'. | |||
encoding_format (Union[Unset, EmbeddingEncodingFormat]): | |||
user (Union[None, Unset, str]): | |||
""" | |||
|
|||
input_: Union[List[str], str] |
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: input_ type is Union[List[str], str], but docstring suggests it should be List[str] or str for image URLs
No description provided.