Skip to content

Overview / CustomOpenAIEmbeddings

CustomOpenAIEmbeddings ​

Extends ​

  • Embeddings

Constructors ​

new CustomOpenAIEmbeddings() ​

new CustomOpenAIEmbeddings(params): CustomOpenAIEmbeddings

Parameters ​

ParameterType
paramsAsyncCallerParams & object

Returns ​

CustomOpenAIEmbeddings

Overrides ​

Embeddings.constructor

Methods ​

embedDocuments() ​

embedDocuments(documents): Promise<number[][]>

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 ​

ParameterTypeDescription
documentsstring[]An array of documents to be embedded.

Returns ​

Promise<number[][]>

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

Overrides ​

Embeddings.embedDocuments


embedQuery() ​

embedQuery(document): Promise<number[]>

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

Parameters ​

ParameterTypeDescription
documentstringA single document to be embedded.

Returns ​

Promise<number[]>

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

Overrides ​

Embeddings.embedQuery

Released under the GPL-3.0 License.