medpromptjs
    Preparing search index...

    Class BaseEmbedding

    BaseEmbedding is a base class for embeddings that communicate with a remote API. It extends the LangChain Embeddings class and provides methods for embedding documents and queries.

    Hierarchy

    • Embeddings
      • BaseEmbedding
    Index

    Constructors

    Properties

    apiKey: string
    baseUrl: string
    caller: AsyncCaller

    The async caller should be used by subclasses to make any async calls, which will thus benefit from the concurrency and retry logic.

    model: string

    Methods

    • Embed a list of documents

      Parameters

      • texts: string[]

        Array of strings to embed

      Returns Promise<number[][]>

      Promise of array of embedding vectors

    • Embed a single query

      Parameters

      • text: string

        String to embed

      Returns Promise<number[]>

      Promise of embedding vector

    • Helper method to get embeddings for a list of texts

      Parameters

      • texts: string[]

        Array of strings to embed

      Returns Promise<number[][]>

      Promise of array of embedding vectors