vectordb / Exports / OpenAIEmbeddingFunction
Class: OpenAIEmbeddingFunction
An embedding function that automatically creates vector representation for a given column.
Implements
EmbeddingFunction
\<string
>
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
Properties
_modelName
β’ Private
Readonly
_modelName: string
Defined in
_openai
β’ Private
Readonly
_openai: OpenAI
Defined in
sourceColumn
β’ sourceColumn: string
The name of the column that will be used as input for the Embedding Function.
Implementation of
EmbeddingFunction.sourceColumn
Defined in
Methods
embed
βΈ embed(data
): Promise
\<number
[][]>
Creates a vector representation for the given values.
Parameters
Name | Type |
---|---|
data |
string [] |
Returns
Promise
\<number
[][]>