Files
lancedb/docs/src/js/classes/embedding.OpenAIEmbeddingFunction.md
Weston Pace e21b56293c docs: add a reference to @lancedb/lance in the docs (#1166)
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`
2024-04-05 16:34:39 -07:00

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

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

OpenAIEmbeddingFunction

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:61

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:48