Skip to content
1 min read · 208 words

@nhtio/adk/batteries/embeddings/openai/types ​

Option and wire-shape types for the OpenAI Embeddings adapter, plus the shared embeddings battery base type both bundled embeddings batteries build on.

Remarks ​

This module owns the shared embeddings option base (BaseEmbeddingsAdapterOptions) and the shared call shapes (EmbeddingKind, EmbedOptions). The WebLLM Embeddings battery re-exports and extends these rather than redefining them, so the two batteries differ only in their engine — exactly how the WebLLM Chat Completions battery extends the OpenAI Chat Completions option type.

Interfaces ​

InterfaceDescription
BaseEmbeddingsAdapterOptionsOptions shared by every embeddings battery, regardless of engine.
EmbeddingsRetryConfigRetry/backoff configuration for HTTP-backed embeddings batteries. Mirrors the chat battery's ChatCompletionsRetryConfig so behavior is consistent across the bundled batteries.
EmbedOptionsPer-call options accepted by embed / embedMany. Identical across both batteries.
OpenAIEmbeddingsAdapterOptionsConstructor options for @nhtio/adk/batteries/embeddings/openai/adapter!OpenAIEmbeddingsAdapter.
OpenAIEmbeddingsRequestBodyThe JSON request body POSTed to /v1/embeddings.
OpenAIEmbeddingsResponseBodyThe relevant subset of the /v1/embeddings JSON response shape.

Type Aliases ​

Type AliasDescription
EmbeddingKindWhether a piece of text is being embedded as a search query or as a corpus document.