feat(nodejs): table.search functionality (#1341)

closes https://github.com/lancedb/lancedb/issues/1256
This commit is contained in:
Cory Grinstead
2024-06-04 14:04:03 -05:00
committed by GitHub
parent d9fb6457e1
commit 70f92f19a6
6 changed files with 163 additions and 10 deletions

View File

@@ -19,6 +19,7 @@ import {
FixedSizeList,
Float,
Float32,
type IntoVector,
isDataType,
isFixedSizeList,
isFloat,
@@ -169,9 +170,7 @@ export abstract class EmbeddingFunction<
/**
Compute the embeddings for a single query
*/
async computeQueryEmbeddings(
data: T,
): Promise<number[] | Float32Array | Float64Array> {
async computeQueryEmbeddings(data: T): Promise<IntoVector> {
return this.computeSourceEmbeddings([data]).then(
(embeddings) => embeddings[0],
);