generative-ai-go
generative-ai-go copied to clipboard
Added Dimensionality Setting to Embedding Client
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."
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.