Skip to content

fix(provider/google-vertex): support embedding model settings#15325

Open
Kage18 wants to merge 1 commit into
vercel:mainfrom
Kage18:kage-fix-vertex-embedding-default-options
Open

fix(provider/google-vertex): support embedding model settings#15325
Kage18 wants to merge 1 commit into
vercel:mainfrom
Kage18:kage-fix-vertex-embedding-default-options

Conversation

@Kage18

@Kage18 Kage18 commented May 15, 2026

Copy link
Copy Markdown
Contributor

Summary

Fixes #7262.

vertex.textEmbeddingModel() is documented with an optional settings argument such as { outputDimensionality }, but the provider type and constructor path only accepted a model id.

This adds optional default embedding settings to:

  • vertex.embeddingModel(modelId, settings)
  • vertex.textEmbeddingModel(modelId, settings)

The defaults are merged into embedding requests, and per-call provider options still take precedence.

Tests

  • pnpm --dir packages/google-vertex exec vitest --config vitest.node.config.js --run src/google-vertex-provider-base.test.ts src/google-vertex-embedding-model.test.ts
  • pnpm --filter @ai-sdk/google-vertex type-check

@Kage18

Kage18 commented May 15, 2026

Copy link
Copy Markdown
Contributor Author

Kage usage for this PR:

This PR fixed #7262 by allowing default embedding settings on vertex.embeddingModel(modelId, settings) and vertex.textEmbeddingModel(modelId, settings).

How Kage helped:

  • Scoped recall to packages/google-vertex provider construction and embedding-model request behavior.
  • Kept the relevant files together: google-vertex-provider-base.ts, google-vertex-embedding-model.ts, and their focused tests.
  • Helped preserve the provider-option precedence rule: constructor defaults are merged into embedding requests, but per-call provider options still win.
  • Captured that docs already implied settings such as outputDimensionality, while the provider type/constructor path did not support them.
  • Captured the verification commands for provider-base tests, embedding-model tests, and package type-checking.

Why this matters for future sessions:
A future agent touching Vertex embeddings can recall the default-settings merge behavior and avoid breaking per-call overrides while changing provider construction.

Full contribution summary and Kage metrics: kage-core/Kage#8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TypeScript Error: vertex.textEmbeddingModel doesn't accept outputDimensionality parameter

1 participant