Class RerankingAPIKeyHeaderProvider

Overview

The most basic reranking 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 RerankingAPIKeyHeaderProvider under the hood.

Example

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

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

See

RerankingHeadersProvider

Hierarchy (view full)

Constructors

Properties

Methods

Constructors

Properties

#headers: Record<string, undefined | string>
_phant: "Expected a HeaderProvider specifically for rerankings (e.g. `class RerankingHeadersProvider extends HeadersProvider<'reranking'>`)."
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