mirror of
https://github.com/lancedb/lancedb.git
synced 2026-01-07 12:22:59 +00:00
add openai embedding function to nodejs client (#107)
- openai is an optional dependency for lancedb - added an example to show how to use it
This commit is contained in:
@@ -154,7 +154,7 @@ describe('LanceDB client', function () {
|
||||
['bar', [3.1, 3.2]]
|
||||
])
|
||||
|
||||
embed (data: string[]): number[][] {
|
||||
async embed (data: string[]): Promise<number[][]> {
|
||||
return data.map(datum => this._embedding_map.get(datum) ?? [0.0, 0.0])
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user