generative-ai-go icon indicating copy to clipboard operation
generative-ai-go copied to clipboard

Added Dimensionality Setting to Embedding Client

Open sgeorgevv opened this issue 8 months ago • 1 comments

Add support for output dimension control in embedding models

This PR adds the ability to specify a reduced output dimension for embedding models. Key changes:

  • Add optional outputDimension field to EmbeddingModel
  • Add SetOutputDimension method for configuration
  • Update request handling to include dimension when specified
  • Propagate dimension parameter through batch operations

Supports the functionality described in the API docs: "Optional reduced dimension for the output embedding. If set, excessive values in the output embedding are truncated from the end. Supported by newer models since 2024."

sgeorgevv avatar Mar 25 '25 00:03 sgeorgevv

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

google-cla[bot] avatar Mar 25 '25 00:03 google-cla[bot]