Skip to content

vectordb / Exports / OpenAIEmbeddingFunction

Class: OpenAIEmbeddingFunction

An embedding function that automatically creates vector representation for a given column.

Implements

Table of contents

Constructors

Properties

Methods

Constructors

constructor

β€’ new OpenAIEmbeddingFunction(sourceColumn, openAIKey, modelName?)

Parameters

Name Type Default value
sourceColumn string undefined
openAIKey string undefined
modelName string 'text-embedding-ada-002'

Defined in

embedding/openai.ts:22

Properties

_modelName

β€’ Private Readonly _modelName: string

Defined in

embedding/openai.ts:20


_openai

β€’ Private Readonly _openai: OpenAI

Defined in

embedding/openai.ts:19


sourceColumn

β€’ sourceColumn: string

The name of the column that will be used as input for the Embedding Function.

Implementation of

EmbeddingFunction.sourceColumn

Defined in

embedding/openai.ts:56

Methods

embed

β–Έ embed(data): Promise\<number[][]>

Creates a vector representation for the given values.

Parameters

Name Type
data string[]

Returns

Promise\<number[][]>

Implementation of

EmbeddingFunction.embed

Defined in

embedding/openai.ts:43