mirror of
https://github.com/lancedb/lancedb.git
synced 2026-01-08 12:52:58 +00:00
We aren't yet ready to switch over the examples since almost all JS examples rely on embeddings and we haven't yet ported those over. However, this makes it possible for those that are interested to start using `@lancedb/lancedb`
2.7 KiB
2.7 KiB
@lancedb/lancedb / Exports / embedding / OpenAIEmbeddingFunction
Class: OpenAIEmbeddingFunction
embedding.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?): OpenAIEmbeddingFunction
Parameters
| Name | Type | Default value |
|---|---|---|
sourceColumn |
string |
undefined |
openAIKey |
string |
undefined |
modelName |
string |
"text-embedding-ada-002" |
Returns
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[][]>