weaviate-client
Version:
JS/TS client for Weaviate
59 lines (58 loc) • 1.65 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.MultiVectorEncodingGuards = exports.VectorIndexGuards = exports.QuantizerGuards = void 0;
exports.parseWithDefault = parseWithDefault;
class QuantizerGuards {
static isPQCreate(config) {
return config?.type === 'pq';
}
static isPQUpdate(config) {
return config?.type === 'pq';
}
static isBQCreate(config) {
return config?.type === 'bq';
}
static isBQUpdate(config) {
return config?.type === 'bq';
}
static isSQCreate(config) {
return config?.type === 'sq';
}
static isSQUpdate(config) {
return config?.type === 'sq';
}
static isRQCreate(config) {
return config?.type === 'rq';
}
static isRQUpdate(config) {
return config?.type === 'rq';
}
static isUncompressedCreate(config) {
return config?.type === 'none';
}
}
exports.QuantizerGuards = QuantizerGuards;
class VectorIndexGuards {
static isHNSW(config) {
return config?.type === 'hnsw';
}
static isFlat(config) {
return config?.type === 'flat';
}
static isHFresh(config) {
return config?.type === 'hfresh';
}
static isDynamic(config) {
return config?.type === 'dynamic';
}
}
exports.VectorIndexGuards = VectorIndexGuards;
class MultiVectorEncodingGuards {
static isMuvera(config) {
return config?.type === 'muvera';
}
}
exports.MultiVectorEncodingGuards = MultiVectorEncodingGuards;
function parseWithDefault(value, defaultValue) {
return value !== undefined ? value : defaultValue;
}