-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Adding support for specifying embedding type to Jina AI service settings #121548
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
Conversation
51f5fce to
00ba02e
Compare
00ba02e to
d4e7a92
Compare
|
Hi @ymao1, I've created a changelog YAML for you. |
|
Pinging @elastic/ml-core (Team:ML) |
| out.writeOptionalVInt(dimensions); | ||
| out.writeOptionalVInt(maxInputTokens); | ||
|
|
||
| if (out.getTransportVersion().onOrAfter(TransportVersions.JINA_AI_EMBEDDING_TYPE_SUPPORT_ADDED) |
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.
Since we use this if logic a few times how about we move it into its own function?
Something like isEmbeddingTypeSupported(TransportVersion version) or something like that.
💚 All backports created successfully
Questions ?Please refer to the Backport tool documentation |
…ngs (elastic#121548) * Adding embeddings type to Jina AI service settings * Update docs/changelog/121548.yaml * Setting default similarity to L2 norm for binary embedding type (cherry picked from commit 6b2e566) # Conflicts: # server/src/main/java/org/elasticsearch/TransportVersions.java
… settings (#121548) (#124010) * Adding support for specifying embedding type to Jina AI service settings (#121548) * Adding embeddings type to Jina AI service settings * Update docs/changelog/121548.yaml * Setting default similarity to L2 norm for binary embedding type (cherry picked from commit 6b2e566) # Conflicts: # server/src/main/java/org/elasticsearch/TransportVersions.java * [CI] Auto commit changes from spotless --------- Co-authored-by: elasticsearchmachine <[email protected]>
…ngs (elastic#121548) * Adding embeddings type to Jina AI service settings * Update docs/changelog/121548.yaml * Setting default similarity to L2 norm for binary embedding type
Summary
Adding the ability to specify
embedding_typein the Jina AI service settings when creating a Jina AI inference endpoint.Usage
embedding_typewill default to thefloatembedding type (same as previous behavior)['float', 'bit', 'binary']embedding_type: 'bit'orembedding_type: 'binary'will return results in thetext_embedding_bitskey (same as Cohere)Notes
Same as Cohere, requesting a binary embedding from Jina AI will returns an array of binary embeddings packed as bytes with int8 precision. Since this aligns with what is expected as input when you specify a dense_vector mapping with element_type: bit, we do not perform any bit unpacking on the response and handle the bytes as-is.