Skip to content

[ML] Bedrock Cohere support for embedding types #126565

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

prwhelan
Copy link
Member

@prwhelan prwhelan commented Apr 9, 2025

Add support for passing embedding types in the service settings, enabling float, int8, and binary embeddings returned in the response.

Close #126526

Add support for passing embedding types in the service settings,
enabling float, int8, and binary embeddings returned in the response.

Close elastic#126526
@prwhelan prwhelan added >enhancement :ml Machine learning Team:ML Meta label for the ML team v8.19.0 v9.1.0 labels Apr 9, 2025
@elasticsearchmachine
Copy link
Collaborator

Hi @prwhelan, I've created a changelog YAML for you.

@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/ml-core (Team:ML)

@@ -71,6 +76,15 @@ private static AmazonBedrockEmbeddingsServiceSettings embeddingSettingsFromMap(

Boolean dimensionsSetByUser = extractOptionalBoolean(map, DIMENSIONS_SET_BY_USER, validationException);

var embeddingType = extractOptionalEnum(
Copy link
Member

Choose a reason for hiding this comment

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

This is a tricky one as the embedding type option depends on the provider but it must go in the service settings as the type cannot change. We can rely on the validate step to catch any cases where the setting must be set but isn't and where the value is not supported.

#126540 is a community contribution that addresses the same missing embedding type problem for Titan. They have added an AmazonBedrockEmbeddingType class, we could map that type to the specific supported values for the provider. And if the provider does not support that type then the validation will fail.

https://github.com/elastic/elasticsearch/pull/126540/files#diff-73bad4ea6d9d6626fb73c2489b51bf631a9ef592f39599e9be8b372c16e11c38

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't mind waiting until after their change is in, and then we can work from there?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>enhancement :ml Machine learning Team:ML Meta label for the ML team v8.19.0 v9.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ML] Bedrock Cohere should support embedding_type
3 participants