dyna-record
    Preparing search index...

    Type Alias EmbeddingProvider

    EmbeddingProvider: (text: string) => Promise<number[]>

    An embed function supplied by the consumer on a vector index definition. Takes the text to embed and resolves to the embedding vector, which must have the dimensions declared by the index's EmbeddingModelDescriptor.

    Usage example (consumer-owned Bedrock provider):

    const provider: EmbeddingProvider = async text => {
    const res = await bedrock.send(
    new InvokeModelCommand({
    modelId: TitanTextEmbedV2.name,
    body: JSON.stringify({ inputText: text })
    })
    );
    return JSON.parse(new TextDecoder().decode(res.body)).embedding;
    };

    Type Declaration

      • (text: string): Promise<number[]>
      • Parameters

        • text: string

        Returns Promise<number[]>