fix(nodejs): lancedb arrow dependency (#1458)

previously if you tried to install both vectordb and @lancedb/lancedb,
you would get a peer dependency issue due to `vectordb` requiring
`14.0.2` and `@lancedb/lancedb` requiring `15.0.0`. now
`@lancedb/lancedb` should just work with any arrow version 13-17
This commit is contained in:
Cory Grinstead
2024-07-19 11:21:55 -05:00
committed by GitHub
parent ed7bd45c17
commit 3b88f15774
7 changed files with 1089 additions and 839 deletions

View File

@@ -15,10 +15,11 @@
import "reflect-metadata";
import {
DataType,
DataTypeLike,
Field,
FixedSizeList,
Float,
Float32,
FloatLike,
type IntoVector,
isDataType,
isFixedSizeList,
@@ -89,8 +90,8 @@ export abstract class EmbeddingFunction<
* @see {@link lancedb.LanceSchema}
*/
sourceField(
optionsOrDatatype: Partial<FieldOptions> | DataType,
): [DataType, Map<string, EmbeddingFunction>] {
optionsOrDatatype: Partial<FieldOptions> | DataTypeLike,
): [DataTypeLike, Map<string, EmbeddingFunction>] {
let datatype = isDataType(optionsOrDatatype)
? optionsOrDatatype
: optionsOrDatatype?.datatype;
@@ -169,7 +170,7 @@ export abstract class EmbeddingFunction<
}
/** The datatype of the embeddings */
abstract embeddingDataType(): Float;
abstract embeddingDataType(): FloatLike;
/**
* Creates a vector representation for the given values.