Provider-aware embedding options.
OptionalapiKey?: stringGemini API key. Defaults to AI_KEY.
OptionalbeforeRequest?: () => void | Promise<void>Awaits caller-controlled pacing immediately before an uncached provider request. Cache hits skip this hook. Throwing prevents dispatch and caching. The hook is excluded from embedding identity and cache keys.
Optionalcache?: booleanWhether to persist and reuse the embedding response. Defaults to true.
OptionalcontextWindow?: undefinedOllama context windows are not valid for the Gemini API.
Optionallocation?: undefinedVertex locations are not valid for the Gemini API.
Optionalmodel?: stringThe embedding model. Defaults to AI_EMBEDDINGS_MODEL.
Optionalollama?: undefinedOllama clients are not valid for the Gemini API.
Optionalproject?: undefinedVertex projects are not valid for the Gemini API.
Explicitly selects the Google embedding provider.
Optionalverbose?: booleanWhether to log request and timing information.
Optionalvertex?: falseKeeps the request on the Gemini API rather than Vertex AI.
OptionalapiKey?: stringVertex Express Mode API key.
OptionalbeforeRequest?: () => void | Promise<void>Awaits caller-controlled pacing immediately before an uncached provider request. Cache hits skip this hook. Throwing prevents dispatch and caching. The hook is excluded from embedding identity and cache keys.
Optionalcache?: booleanWhether to persist and reuse the embedding response. Defaults to true.
OptionalcontextWindow?: undefinedOllama context windows are not valid for Vertex AI.
Optionallocation?: stringGoogle Cloud location. Defaults to AI_LOCATION.
Optionalmodel?: stringThe embedding model. Defaults to AI_EMBEDDINGS_MODEL.
Optionalollama?: undefinedOllama clients are not valid for Vertex AI.
Optionalproject?: stringGoogle Cloud project. Defaults to AI_PROJECT.
Explicitly selects the Google embedding provider.
Optionalverbose?: booleanWhether to log request and timing information.
Selects the Vertex AI backend.
OptionalapiKey?: undefinedGemini and Vertex API keys are not valid for Ollama.
OptionalbeforeRequest?: () => void | Promise<void>Awaits caller-controlled pacing immediately before an uncached provider request. Cache hits skip this hook. Throwing prevents dispatch and caching. The hook is excluded from embedding identity and cache keys.
Optionalcache?: booleanWhether to persist and reuse the embedding response. Defaults to true.
OptionalcontextWindow?: numberThe model context-window size sent to Ollama.
Optionallocation?: undefinedVertex locations are not valid for Ollama.
Optionalmodel?: stringThe embedding model. Defaults to AI_EMBEDDINGS_MODEL.
Optionalollama?: {A custom Ollama client.
OptionalembeddingEndpoint?: stringNon-secret deployment endpoint for custom adapters that are not instances of the Ollama SDK client.
Sends an embedding request to Ollama.
Optionalproject?: undefinedVertex projects are not valid for Ollama.
Explicitly selects Ollama.
Optionalverbose?: booleanWhether to log request and timing information.
Optionalvertex?: undefinedVertex selection is not valid for Ollama.
OptionalapiKey?: undefinedDirect credentials require an explicit provider.
OptionalbeforeRequest?: () => void | Promise<void>Awaits caller-controlled pacing immediately before an uncached provider request. Cache hits skip this hook. Throwing prevents dispatch and caching. The hook is excluded from embedding identity and cache keys.
Optionalcache?: booleanWhether to persist and reuse the embedding response. Defaults to true.
OptionalcontextWindow?: undefinedProvider-specific semantic options require an explicit provider.
Optionallocation?: undefinedDirect deployment selection requires an explicit provider.
Optionalmodel?: stringThe embedding model. Defaults to AI_EMBEDDINGS_MODEL.
Optionalollama?: undefinedCustom clients require an explicit provider.
Optionalproject?: undefinedDirect deployment selection requires an explicit provider.
Optionalprovider?: undefinedOmit the discriminator to select the provider from the environment.
Optionalverbose?: booleanWhether to log request and timing information.
Optionalvertex?: undefinedDirect backend selection requires an explicit provider.
Environment used to resolve omitted values.
The canonical identity used by embedding caches.
Resolved Gemini API backend.
Resolved embedding model.
Resolved provider.
Cache-compatibility schema for the canonical identity.
Resolved Vertex AI backend.
Optionallocation?: stringResolved Google Cloud location, when configured.
Resolved embedding model.
Optionalproject?: stringResolved Google Cloud project, when configured.
Resolved provider.
Cache-compatibility schema for the canonical identity.
Resolved Ollama backend.
OptionalcontextWindow?: numberContext-window size when explicitly configured.
Non-secret Ollama endpoint identity.
Resolved embedding model.
Resolved provider.
Cache-compatibility schema for the canonical identity.
Returns the canonical, non-secret identity for an embedding request. Downstream persisted data can compare this value to decide whether vectors are compatible with the current request.