Hierarchy

  • Embeddings
    • JinaEmbeddings

Implements

Constructors

Properties

apiKey: string
baseUrl: string = "https://api.jina.ai/v1/embeddings"
batchSize: number = 24

The maximum number of documents to embed in a single request.

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.

dimensions: number = 1024

The dimensions of the embedding.

model: string = "jina-clip-v2"

Model name to use

normalized: boolean = true

Scales the embedding so its Euclidean (L2) norm becomes 1, preserving direction. Useful when downstream involves dot-product, classification, visualization..

stripNewLines: boolean = true

Whether to strip new lines from the input text.

Methods

  • An abstract method that takes an array of documents as input and returns a promise that resolves to an array of vectors for each document.

    Parameters

    Returns Promise<number[][]>

    A promise that resolves to an array of vectors for each document.

  • An abstract method that takes a single document as input and returns a promise that resolves to a vector for the query document.

    Parameters

    Returns Promise<number[]>

    A promise that resolves to a vector for the query document.