Class EmbeddingAPIKeyHeaderProvider

Overview

The most basic embedding header provider, used for the vast majority of providers.

Generally, anywhere this can be used in the public astra-db-ts interfaces, you may also pass in a plain string or null/undefined, which is transformed into an EmbeddingAPIKeyHeaderProvider under the hood.

Example

const provider = new EmbeddingAPIKeyHeaderProvider('api-key');
const collections = await db.collections('my_coll', { embeddingApiKey: provider });

// or just
const collections = await db.collections('my_coll', { embeddingApiKey: 'api-key' });

See

EmbeddingHeadersProvider

Hierarchy (view full)

Constructors

Properties

Methods

Constructors

Properties

#headers: Record<string, undefined | string>
_phant: "Expected a HeaderProvider specifically for embeddings (e.g. `class EmbeddingHeadersProvider extends HeadersProvider<'embedding'>`)."
opts: {
    fromObj: MonoidalOptionsHandler<ObjBasedTypes>;
    fromStr: (<Tag>(kleisli) => MonoidalOptionsHandler<StrBasedTypes>);
    monoid: Monoid<ParsedHeadersProviders>;
    parsed: ParsedHeadersProviders;
}

Type declaration

  • fromObj: MonoidalOptionsHandler<ObjBasedTypes>
  • fromStr: (<Tag>(kleisli) => MonoidalOptionsHandler<StrBasedTypes>)
  • monoid: Monoid<ParsedHeadersProviders>
  • parsed: ParsedHeadersProviders

Methods