Skip to content

Conversation

jonathan-buttner
Copy link
Contributor

@jonathan-buttner jonathan-buttner commented Aug 11, 2025

This PR adds support for passing the dimensions field through to the request to send to google vertex ai. We had included the field in the service settings but didn't send it in the request.

The dimensions field maps to outputDimensionality https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/text-embeddings-api

Testing

PUT _inference/text_embedding/test { "service": "googlevertexai", "service_settings": { "service_account_json": "<service_account>", "model_id": "gemini-embedding-001", "location": "us-central1", "project_id": "elastic-ml", "dimensions": 10 } } 

Generate embeddings

POST _inference/text_embedding/test { "input": ["The food was delicious"] } 

Response

{ "text_embedding": [ { "embedding": [ 0.0038749145, -0.0017926422, 0.00781796, -0.06123169, -0.0026226782, -0.012737362, 0.016699702, -0.016461374, -0.007187545, 0.016607152 ] } ] } 
@jonathan-buttner jonathan-buttner added >enhancement :ml Machine learning Team:ML Meta label for the ML team v9.2.0 labels Aug 11, 2025
@elasticsearchmachine
Copy link
Collaborator

Hi @jonathan-buttner, I've created a changelog YAML for you.


builder.endArray();

if (taskSettings.autoTruncate() != null) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This change will allow an empty object for parameters to be sent. I verified that sending

"parameters": {} 

succeeds.

@jonathan-buttner jonathan-buttner marked this pull request as ready for review August 11, 2025 21:12
@elasticsearchmachine
Copy link
Collaborator

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

Copy link
Member

@davidkyle davidkyle left a comment

Choose a reason for hiding this comment

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

LGTM

@jonathan-buttner jonathan-buttner merged commit 0165233 into elastic:main Aug 14, 2025
33 checks passed
joshua-adams-1 pushed a commit to joshua-adams-1/elasticsearch that referenced this pull request Aug 14, 2025
…132689) * Add support for dimensions in request * Update docs/changelog/132689.yaml
szybia added a commit to szybia/elasticsearch that referenced this pull request Aug 15, 2025
* upstream/main: (278 commits) ESQL - dense vector support cosine normalization (elastic#132721) [ML] Add support for dimensions in google vertex ai request (elastic#132689) ESQL - Add byte element support for dense_vector data type (elastic#131863) ESQL: Fix async operator warnings not always sent when blocking (elastic#132744) Method not needed anymore (elastic#132912) [Test] Excercise shutdown more reliably in snapshot stress IT (elastic#132909) Update Gradle shadow plugin to 9.0.1 (elastic#132637) Mute org.elasticsearch.test.rest.yaml.CcsCommonYamlTestSuiteIT test {p0=search/410_named_queries/named_queries_with_score} elastic#132906 Update docker.elastic.co/wolfi/chainguard-base-fips:latest Docker digest to fa6cb69 (elastic#132735) Remove unnecessary calls to fold() (elastic#131870) Use consistent terminology for transport version resources/references (elastic#132882) Mute org.elasticsearch.test.rest.yaml.CcsCommonYamlTestSuiteIT test {p0=search.vectors/40_knn_search_cosine/kNN search only regular query} elastic#132890 Finalize release notes for v9.1.2 release (elastic#132745) Finalize release notes for v9.0.5 release (elastic#132718) Move inner records out of TransportVersionUtils (elastic#132872) Add support for Lookup Join on Multiple Fields (elastic#131559) Bootstrap PR-based benchmarks (elastic#132717) Refactor MetadataIndexTemplateService to use template maps instead of project metadata (elastic#132662) [Gradle] Update nebula ospackage plugin to 12.1.0 (elastic#132640) Mute org.elasticsearch.xpack.esql.CsvTests test {csv-spec:ip.CdirMatchEqualsInsOrs} elastic#132860 ...
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 v9.2.0

3 participants