@zilliz/milvus2-sdk-node 2.6.0 → 2.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/milvus/MilvusClient.js +7 -1
- package/dist/milvus/MilvusClient.js.map +1 -1
- package/dist/milvus/const/milvus.d.ts +38 -4
- package/dist/milvus/const/milvus.js +41 -2
- package/dist/milvus/const/milvus.js.map +1 -1
- package/dist/milvus/grpc/BaseClient.d.ts +1 -0
- package/dist/milvus/grpc/BaseClient.js +1 -0
- package/dist/milvus/grpc/BaseClient.js.map +1 -1
- package/dist/milvus/grpc/Collection.d.ts +2 -2
- package/dist/milvus/grpc/Collection.js +23 -4
- package/dist/milvus/grpc/Collection.js.map +1 -1
- package/dist/milvus/grpc/Data.d.ts +58 -21
- package/dist/milvus/grpc/Data.js +153 -61
- package/dist/milvus/grpc/Data.js.map +1 -1
- package/dist/milvus/proto-json/milvus.base.d.ts +769 -8
- package/dist/milvus/proto-json/milvus.base.js +793 -11
- package/dist/milvus/proto-json/milvus.base.js.map +1 -1
- package/dist/milvus/proto-json/milvus.d.ts +769 -8
- package/dist/milvus/proto-json/milvus.js +793 -11
- package/dist/milvus/proto-json/milvus.js.map +1 -1
- package/dist/milvus/proto-json/schema.base.d.ts +212 -0
- package/dist/milvus/proto-json/schema.base.js +220 -5
- package/dist/milvus/proto-json/schema.base.js.map +1 -1
- package/dist/milvus/types/Collection.d.ts +8 -2
- package/dist/milvus/types/Common.d.ts +3 -0
- package/dist/milvus/types/Data.d.ts +1 -300
- package/dist/milvus/types/Data.js +0 -1
- package/dist/milvus/types/Data.js.map +1 -1
- package/dist/milvus/types/DataTypes.d.ts +35 -0
- package/dist/milvus/types/DataTypes.js +3 -0
- package/dist/milvus/types/DataTypes.js.map +1 -0
- package/dist/milvus/types/HighLevel.d.ts +1 -1
- package/dist/milvus/types/Insert.d.ts +66 -0
- package/dist/milvus/types/Insert.js +4 -0
- package/dist/milvus/types/Insert.js.map +1 -0
- package/dist/milvus/types/Search.d.ts +147 -0
- package/dist/milvus/types/Search.js +4 -0
- package/dist/milvus/types/Search.js.map +1 -0
- package/dist/milvus/types/Segments.d.ts +68 -0
- package/dist/milvus/types/Segments.js +3 -0
- package/dist/milvus/types/Segments.js.map +1 -0
- package/dist/milvus/types/index.d.ts +4 -0
- package/dist/milvus/types/index.js +4 -0
- package/dist/milvus/types/index.js.map +1 -1
- package/dist/milvus/types.d.ts +4 -0
- package/dist/milvus/types.js +4 -1
- package/dist/milvus/types.js.map +1 -1
- package/dist/milvus/utils/Bytes.d.ts +5 -5
- package/dist/milvus/utils/Bytes.js +11 -10
- package/dist/milvus/utils/Bytes.js.map +1 -1
- package/dist/milvus/utils/Connection.d.ts +14 -0
- package/dist/milvus/utils/Connection.js +24 -0
- package/dist/milvus/utils/Connection.js.map +1 -0
- package/dist/milvus/utils/Data.d.ts +43 -0
- package/dist/milvus/utils/Data.js +297 -0
- package/dist/milvus/utils/Data.js.map +1 -0
- package/dist/milvus/utils/Format.d.ts +1 -233
- package/dist/milvus/utils/Format.js +108 -728
- package/dist/milvus/utils/Format.js.map +1 -1
- package/dist/milvus/utils/Function.d.ts +1 -21
- package/dist/milvus/utils/Function.js +1 -79
- package/dist/milvus/utils/Function.js.map +1 -1
- package/dist/milvus/utils/Schema.d.ts +59 -0
- package/dist/milvus/utils/Schema.js +256 -0
- package/dist/milvus/utils/Schema.js.map +1 -0
- package/dist/milvus/utils/Search.d.ts +193 -0
- package/dist/milvus/utils/Search.js +419 -0
- package/dist/milvus/utils/Search.js.map +1 -0
- package/dist/milvus/utils/index.d.ts +4 -0
- package/dist/milvus/utils/index.js +4 -0
- package/dist/milvus/utils/index.js.map +1 -1
- package/dist/sdk.json +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildFieldData = exports.buildFieldDataMap = exports.processStructArraysData = exports.processScalarData = exports.processVectorData = exports.buildDynamicRow = void 0;
|
|
4
|
+
const __1 = require("../");
|
|
5
|
+
/**
|
|
6
|
+
* Builds a dynamic row object by separating the input data into non-dynamic fields and a dynamic field.
|
|
7
|
+
*
|
|
8
|
+
* @param {RowData} rowData - The input data object.
|
|
9
|
+
* @param {Map<string, Field>} fieldMap - A map of field names to field objects.
|
|
10
|
+
* @param {string} dynamicFieldName - The name of the dynamic field.
|
|
11
|
+
* @returns {RowData} The generated dynamic row object.
|
|
12
|
+
*/
|
|
13
|
+
const buildDynamicRow = (rowData, fieldMap, dynamicFieldName, functionOutputFields) => {
|
|
14
|
+
const originRow = (0, __1.cloneObj)(rowData);
|
|
15
|
+
const row = {};
|
|
16
|
+
// iterate through each key in the input data object
|
|
17
|
+
for (let key in originRow) {
|
|
18
|
+
row[dynamicFieldName] = row[dynamicFieldName] || {}; // initialize the dynamic field object
|
|
19
|
+
if (fieldMap.has(key)) {
|
|
20
|
+
// if the key is in the fieldMap, add it to the non-dynamic fields
|
|
21
|
+
row[key] = originRow[key];
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
if (!functionOutputFields.includes(key)) {
|
|
25
|
+
const obj = row[dynamicFieldName];
|
|
26
|
+
// otherwise, add it to the dynamic field
|
|
27
|
+
obj[key] = originRow[key];
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return row; // return the generated dynamic row object
|
|
32
|
+
};
|
|
33
|
+
exports.buildDynamicRow = buildDynamicRow;
|
|
34
|
+
/**
|
|
35
|
+
* Processes vector data from gRPC response format
|
|
36
|
+
* @param item - The vector field item from gRPC response
|
|
37
|
+
* @param transformers - Optional transformers for data conversion
|
|
38
|
+
* @returns Processed vector data
|
|
39
|
+
*/
|
|
40
|
+
const processVectorData = (item, transformers) => {
|
|
41
|
+
var _a;
|
|
42
|
+
const dataKey = item.vectors.data;
|
|
43
|
+
let field_data;
|
|
44
|
+
switch (dataKey) {
|
|
45
|
+
case 'float_vector':
|
|
46
|
+
case 'binary_vector':
|
|
47
|
+
const vectorValue = dataKey === 'float_vector'
|
|
48
|
+
? item.vectors[dataKey].data
|
|
49
|
+
: item.vectors[dataKey].toJSON().data;
|
|
50
|
+
// if binary vector , need use dim / 8 to split vector data
|
|
51
|
+
const dim = ((_a = item.vectors) === null || _a === void 0 ? void 0 : _a.data) === 'float_vector'
|
|
52
|
+
? Number(item.vectors.dim)
|
|
53
|
+
: Number(item.vectors.dim) / 8;
|
|
54
|
+
field_data = [];
|
|
55
|
+
// parse number[] to number[][] by dim
|
|
56
|
+
vectorValue.forEach((v, i) => {
|
|
57
|
+
const index = Math.floor(i / dim);
|
|
58
|
+
if (!field_data[index]) {
|
|
59
|
+
field_data[index] = [];
|
|
60
|
+
}
|
|
61
|
+
field_data[index].push(v);
|
|
62
|
+
});
|
|
63
|
+
break;
|
|
64
|
+
case 'int8_vector':
|
|
65
|
+
field_data = [];
|
|
66
|
+
const int8Dim = Number(item.vectors.dim);
|
|
67
|
+
const int8Bytes = item.vectors[dataKey];
|
|
68
|
+
const localTransformers = Object.assign({ [__1.DataType.Int8Vector]: Array.from }, transformers);
|
|
69
|
+
// split buffer data to int8 vector
|
|
70
|
+
for (let i = 0; i < int8Bytes.byteLength; i += int8Dim) {
|
|
71
|
+
const slice = int8Bytes.slice(i, i + int8Dim);
|
|
72
|
+
field_data.push(localTransformers[__1.DataType.Int8Vector](slice));
|
|
73
|
+
}
|
|
74
|
+
break;
|
|
75
|
+
case 'float16_vector':
|
|
76
|
+
case 'bfloat16_vector':
|
|
77
|
+
field_data = [];
|
|
78
|
+
const f16Dim = Number(item.vectors.dim) * 2; // float16 is 2 bytes, so we need to multiply dim with 2 = one element length
|
|
79
|
+
const f16Bytes = item.vectors[dataKey];
|
|
80
|
+
// split buffer data to float16 vector(bytes)
|
|
81
|
+
for (let i = 0; i < f16Bytes.byteLength; i += f16Dim) {
|
|
82
|
+
const slice = f16Bytes.slice(i, i + f16Dim);
|
|
83
|
+
const isFloat16 = dataKey === 'float16_vector';
|
|
84
|
+
let dataType;
|
|
85
|
+
dataType = isFloat16 ? __1.DataType.Float16Vector : __1.DataType.BFloat16Vector;
|
|
86
|
+
const localTransformers = Object.assign({ [__1.DataType.BFloat16Vector]: __1.bf16BytesToF32Array, [__1.DataType.Float16Vector]: __1.f16BytesToF32Array }, transformers);
|
|
87
|
+
field_data.push(localTransformers[dataType](slice));
|
|
88
|
+
}
|
|
89
|
+
break;
|
|
90
|
+
case 'sparse_float_vector':
|
|
91
|
+
const sparseVectorValue = item.vectors[dataKey].contents;
|
|
92
|
+
field_data = [];
|
|
93
|
+
sparseVectorValue.forEach((buffer, i) => {
|
|
94
|
+
field_data[i] = (0, __1.bytesToSparseRow)(buffer);
|
|
95
|
+
});
|
|
96
|
+
break;
|
|
97
|
+
case 'vector_array':
|
|
98
|
+
field_data = [];
|
|
99
|
+
const vectorArrayValue = item.vectors[dataKey].data;
|
|
100
|
+
vectorArrayValue.forEach((vector) => {
|
|
101
|
+
field_data.push((0, exports.processVectorData)({
|
|
102
|
+
vectors: Object.assign({}, vector),
|
|
103
|
+
}));
|
|
104
|
+
});
|
|
105
|
+
break;
|
|
106
|
+
default:
|
|
107
|
+
break;
|
|
108
|
+
}
|
|
109
|
+
return field_data;
|
|
110
|
+
};
|
|
111
|
+
exports.processVectorData = processVectorData;
|
|
112
|
+
/**
|
|
113
|
+
* Processes scalar data from gRPC response format
|
|
114
|
+
* @param item - The scalar field item from gRPC response
|
|
115
|
+
* @returns Processed scalar data
|
|
116
|
+
*/
|
|
117
|
+
const processScalarData = (item) => {
|
|
118
|
+
// parse scalar data
|
|
119
|
+
const dataKey = item.scalars.data;
|
|
120
|
+
let field_data = item.scalars[dataKey].data;
|
|
121
|
+
// we need to handle array element specifically here
|
|
122
|
+
if (dataKey === 'array_data') {
|
|
123
|
+
field_data = field_data.map((f) => {
|
|
124
|
+
const dataKey = f.data;
|
|
125
|
+
return dataKey ? f[dataKey].data : [];
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
switch (dataKey) {
|
|
129
|
+
// decode json
|
|
130
|
+
case 'json_data':
|
|
131
|
+
field_data.forEach((buffer, i) => {
|
|
132
|
+
field_data[i] = buffer.length ? JSON.parse(buffer.toString()) : null;
|
|
133
|
+
});
|
|
134
|
+
break;
|
|
135
|
+
default:
|
|
136
|
+
break;
|
|
137
|
+
}
|
|
138
|
+
// set the field data with null if item.valid_data is not empty array, it the item in valid_data is false, set the field data with null
|
|
139
|
+
if (item.valid_data && item.valid_data.length) {
|
|
140
|
+
item.valid_data.forEach((v, i) => {
|
|
141
|
+
if (!v) {
|
|
142
|
+
field_data[i] = null;
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
return field_data;
|
|
147
|
+
};
|
|
148
|
+
exports.processScalarData = processScalarData;
|
|
149
|
+
/**
|
|
150
|
+
* Processes struct arrays data from gRPC response format
|
|
151
|
+
* @param item - The struct arrays field item from gRPC response
|
|
152
|
+
* @returns Processed struct arrays data as array of objects
|
|
153
|
+
*/
|
|
154
|
+
const processStructArraysData = (item) => {
|
|
155
|
+
const structArrays = item.struct_arrays;
|
|
156
|
+
const fields = structArrays.fields;
|
|
157
|
+
// Process each field using the existing processScalarData function
|
|
158
|
+
const processedFields = fields.map((field) => {
|
|
159
|
+
return {
|
|
160
|
+
fieldName: field.field_name,
|
|
161
|
+
fieldData: field.scalars
|
|
162
|
+
? (0, exports.processScalarData)(field)
|
|
163
|
+
: (0, exports.processVectorData)(field),
|
|
164
|
+
};
|
|
165
|
+
});
|
|
166
|
+
// Get the number of rows from the first processed field
|
|
167
|
+
const rowCount = processedFields[0].fieldData.length;
|
|
168
|
+
// Initialize result array
|
|
169
|
+
const result = [];
|
|
170
|
+
// Process each row
|
|
171
|
+
for (let rowIndex = 0; rowIndex < rowCount; rowIndex++) {
|
|
172
|
+
// Get the length of arrays in this row (assuming all fields have same array length)
|
|
173
|
+
const firstFieldArray = processedFields[0].fieldData[rowIndex];
|
|
174
|
+
const arrayLength = firstFieldArray.length;
|
|
175
|
+
// Create an array of struct objects for this row
|
|
176
|
+
const rowArray = [];
|
|
177
|
+
for (let arrayIndex = 0; arrayIndex < arrayLength; arrayIndex++) {
|
|
178
|
+
const structObject = {};
|
|
179
|
+
// Process each field in the struct
|
|
180
|
+
processedFields.forEach(({ fieldName, fieldData }) => {
|
|
181
|
+
const fieldArray = fieldData[rowIndex];
|
|
182
|
+
structObject[fieldName] = fieldArray[arrayIndex];
|
|
183
|
+
});
|
|
184
|
+
rowArray.push(structObject);
|
|
185
|
+
}
|
|
186
|
+
result.push(rowArray);
|
|
187
|
+
}
|
|
188
|
+
// Apply valid_data filtering if present
|
|
189
|
+
if (item.valid_data && item.valid_data.length) {
|
|
190
|
+
item.valid_data.forEach((v, i) => {
|
|
191
|
+
if (!v) {
|
|
192
|
+
result[i] = null;
|
|
193
|
+
}
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
return result;
|
|
197
|
+
};
|
|
198
|
+
exports.processStructArraysData = processStructArraysData;
|
|
199
|
+
/**
|
|
200
|
+
* create a data map for each fields, resolve grpc data format
|
|
201
|
+
* If the field is a vector, split the data into chunks of the appropriate size.
|
|
202
|
+
* If the field is a scalar, decode the JSON/array data if necessary.
|
|
203
|
+
*/
|
|
204
|
+
const buildFieldDataMap = (fields_data, transformers) => {
|
|
205
|
+
const fieldsDataMap = new Map();
|
|
206
|
+
fields_data.forEach((item, i) => {
|
|
207
|
+
// field data
|
|
208
|
+
let field_data;
|
|
209
|
+
// parse data based on field type
|
|
210
|
+
if (item.vectors) {
|
|
211
|
+
field_data = (0, exports.processVectorData)(item, transformers);
|
|
212
|
+
}
|
|
213
|
+
else if (item.scalars) {
|
|
214
|
+
field_data = (0, exports.processScalarData)(item);
|
|
215
|
+
}
|
|
216
|
+
else if (item.struct_arrays) {
|
|
217
|
+
field_data = (0, exports.processStructArraysData)(item);
|
|
218
|
+
}
|
|
219
|
+
// Add the parsed data to the fieldsDataMap
|
|
220
|
+
fieldsDataMap.set(item.field_name, field_data);
|
|
221
|
+
});
|
|
222
|
+
return fieldsDataMap;
|
|
223
|
+
};
|
|
224
|
+
exports.buildFieldDataMap = buildFieldDataMap;
|
|
225
|
+
/**
|
|
226
|
+
* Builds the field data for a given row and column.
|
|
227
|
+
*
|
|
228
|
+
* @param {RowData} rowData - The data for the row.
|
|
229
|
+
* @param {Field} column - The column information.
|
|
230
|
+
* @returns {FieldData} The field data for the row and column.
|
|
231
|
+
*/
|
|
232
|
+
const buildFieldData = (rowData, field, transformers, rowIndex) => {
|
|
233
|
+
const { type, elementType, name, fieldMap } = field;
|
|
234
|
+
const isFloat32 = Array.isArray(rowData[name]);
|
|
235
|
+
switch (type) {
|
|
236
|
+
case __1.DataType.BinaryVector:
|
|
237
|
+
case __1.DataType.FloatVector:
|
|
238
|
+
case __1.DataType.Int8Vector:
|
|
239
|
+
return rowData[name];
|
|
240
|
+
case __1.DataType.BFloat16Vector:
|
|
241
|
+
const bf16Transformer = (transformers === null || transformers === void 0 ? void 0 : transformers[__1.DataType.BFloat16Vector]) || __1.f32ArrayToBf16Bytes;
|
|
242
|
+
return isFloat32
|
|
243
|
+
? bf16Transformer(rowData[name])
|
|
244
|
+
: rowData[name];
|
|
245
|
+
case __1.DataType.Float16Vector:
|
|
246
|
+
const f16Transformer = (transformers === null || transformers === void 0 ? void 0 : transformers[__1.DataType.Float16Vector]) || __1.f32ArrayToF16Bytes;
|
|
247
|
+
return isFloat32
|
|
248
|
+
? f16Transformer(rowData[name])
|
|
249
|
+
: rowData[name];
|
|
250
|
+
case __1.DataType.JSON:
|
|
251
|
+
return rowData[name]
|
|
252
|
+
? Buffer.from(JSON.stringify(rowData[name] || {}))
|
|
253
|
+
: Buffer.alloc(0);
|
|
254
|
+
case __1.DataType.Array:
|
|
255
|
+
const elementField = Object.assign(Object.assign({}, field), { type: elementType, fieldMap: fieldMap });
|
|
256
|
+
// Special handling for struct types
|
|
257
|
+
if (elementType == __1.DataType.Struct) {
|
|
258
|
+
// Process each struct element as if it were fields_data
|
|
259
|
+
rowData[name].forEach((structElement, elementIndex) => {
|
|
260
|
+
// get field names
|
|
261
|
+
const fieldNames = Object.keys(structElement);
|
|
262
|
+
// loop through each field name
|
|
263
|
+
fieldNames.forEach(fieldName => {
|
|
264
|
+
const structField = fieldMap.get(fieldName);
|
|
265
|
+
if (!structField) {
|
|
266
|
+
throw new Error(`${__1.ERROR_REASONS.INSERT_CHECK_WRONG_FIELD} in struct at index ${elementIndex}`);
|
|
267
|
+
}
|
|
268
|
+
// Build field data for the struct field
|
|
269
|
+
const fieldData = (0, exports.buildFieldData)({ [fieldName]: structElement[fieldName] }, structField, transformers, rowIndex);
|
|
270
|
+
// Special handling for binary and float vector types
|
|
271
|
+
const dataArray = structField.data[rowIndex] || [];
|
|
272
|
+
structField.data[rowIndex] = dataArray;
|
|
273
|
+
const isVectorType = structField.elementType === __1.DataType.BinaryVector ||
|
|
274
|
+
structField.elementType === __1.DataType.FloatVector;
|
|
275
|
+
if (isVectorType) {
|
|
276
|
+
dataArray.push(...(Array.isArray(fieldData) ? fieldData : [fieldData]));
|
|
277
|
+
}
|
|
278
|
+
else {
|
|
279
|
+
dataArray.push(fieldData);
|
|
280
|
+
}
|
|
281
|
+
});
|
|
282
|
+
});
|
|
283
|
+
// Return the original data for Array of Struct
|
|
284
|
+
return rowData[name];
|
|
285
|
+
}
|
|
286
|
+
else {
|
|
287
|
+
// Regular array field
|
|
288
|
+
return rowData[name] === null
|
|
289
|
+
? undefined
|
|
290
|
+
: (0, exports.buildFieldData)(rowData, elementField, transformers, rowIndex);
|
|
291
|
+
}
|
|
292
|
+
default:
|
|
293
|
+
return rowData[name] === null ? undefined : rowData[name];
|
|
294
|
+
}
|
|
295
|
+
};
|
|
296
|
+
exports.buildFieldData = buildFieldData;
|
|
297
|
+
//# sourceMappingURL=Data.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Data.js","sourceRoot":"","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Type, DataTypeMap, DataType, CreateCollectionReq, DescribeCollectionResponse, RowData, _Field, FieldData, SearchReq, SearchSimpleReq, SearchParam, HybridSearchSingleReq, HybridSearchReq, DslType, SearchRes, ConsistencyLevelEnum, RerankerObj, InsertTransformers, OutputTransformers, SearchDataType, FieldSchema, SearchMultipleDataType, TypeParamKey, keyValueObj } from '../';
|
|
1
|
+
import { KeyValuePair, DescribeCollectionResponse } from '../';
|
|
3
2
|
/**
|
|
4
3
|
* Formats key-value data based on the provided keys.
|
|
5
4
|
* @param {KeyValuePair[]} data - The array of key-value pairs.
|
|
@@ -64,15 +63,6 @@ export declare const stringToBase64: (str: string) => string;
|
|
|
64
63
|
* @returns The formatted address.
|
|
65
64
|
*/
|
|
66
65
|
export declare const formatAddress: (address: string) => string;
|
|
67
|
-
/**
|
|
68
|
-
* Assigns specified properties from the `field` object to `type_params` within the `FieldType` object.
|
|
69
|
-
* Converts properties to strings, serializing objects as JSON strings if needed, then removes them from `field`.
|
|
70
|
-
*
|
|
71
|
-
* @param field - The `FieldType` object to modify.
|
|
72
|
-
* @param typeParamKeys - Keys to assign to `type_params` if present in `field`.
|
|
73
|
-
* @returns The modified `FieldType` object.
|
|
74
|
-
*/
|
|
75
|
-
export declare const assignTypeParams: (field: FieldType, typeParamKeys?: TypeParamKey[]) => FieldType;
|
|
76
66
|
/**
|
|
77
67
|
* Parses a time token and returns the corresponding number of milliseconds.
|
|
78
68
|
*
|
|
@@ -88,13 +78,6 @@ export declare const parseTimeToken: (token: string) => number;
|
|
|
88
78
|
* @returns {string} The extracted method name.
|
|
89
79
|
*/
|
|
90
80
|
export declare const extractMethodName: (query: string) => string;
|
|
91
|
-
/**
|
|
92
|
-
* Converts a `key` of type `keyof typeof DataTypeMap | DataType` to a `DataType`.
|
|
93
|
-
*
|
|
94
|
-
* @param {keyof typeof DataTypeMap | DataType} key - The key to convert.
|
|
95
|
-
* @returns {DataType} The converted `DataType`.
|
|
96
|
-
*/
|
|
97
|
-
export declare const convertToDataType: (key: keyof typeof DataTypeMap | DataType) => DataType;
|
|
98
81
|
/**dd
|
|
99
82
|
* Creates a deep copy of the provided object using JSON.parse and JSON.stringify.
|
|
100
83
|
* Note that this function is not efficient and may cause performance issues if used with large or complex objects. It also does not handle cases where the object being cloned contains functions or prototype methods.
|
|
@@ -104,31 +87,6 @@ export declare const convertToDataType: (key: keyof typeof DataTypeMap | DataTyp
|
|
|
104
87
|
* @returns {T} A new object with the same properties and values as the original.
|
|
105
88
|
*/
|
|
106
89
|
export declare const cloneObj: <T>(obj: T) => T;
|
|
107
|
-
/**
|
|
108
|
-
* Formats the input data into a request payload for creating a collection.
|
|
109
|
-
*
|
|
110
|
-
* @param {CreateCollectionReq} data - The input data for creating a collection.
|
|
111
|
-
* @param {Type} schemaType - The schema type for the collection.
|
|
112
|
-
* @returns {Object} The formatted request payload.
|
|
113
|
-
*/
|
|
114
|
-
export declare const formatCollectionSchema: (data: CreateCollectionReq, schemaTypes: Record<string, Type>) => {
|
|
115
|
-
[k: string]: any;
|
|
116
|
-
};
|
|
117
|
-
/**
|
|
118
|
-
* Formats a field schema by converting its properties to the appropriate types and adding additional properties.
|
|
119
|
-
*
|
|
120
|
-
* @param {FieldType} field - The field to format.
|
|
121
|
-
* @param {Record<string, Type>} schemaTypes - The schema types to use for formatting.
|
|
122
|
-
* @param {Object} [override] - Optional override object for additional properties.
|
|
123
|
-
* @returns {Object} The formatted field schema.
|
|
124
|
-
*/
|
|
125
|
-
export declare const formatFieldSchema: (field: FieldType, schemaTypes: Record<string, Type>, override?: {
|
|
126
|
-
partition_key_field?: string;
|
|
127
|
-
functionOutputFields?: string[];
|
|
128
|
-
clustring_key_field?: string;
|
|
129
|
-
}) => {
|
|
130
|
-
[k: string]: any;
|
|
131
|
-
};
|
|
132
90
|
/**
|
|
133
91
|
* Formats a `DescribeCollectionResponse` object by adding a `dataType` property to each field object in its `schema` array.
|
|
134
92
|
* The `dataType` property represents the numerical value of the `data_type` property.
|
|
@@ -137,193 +95,3 @@ export declare const formatFieldSchema: (field: FieldType, schemaTypes: Record<s
|
|
|
137
95
|
* @returns {DescribeCollectionResponse} A new `DescribeCollectionResponse` object with the updated `dataType` properties.
|
|
138
96
|
*/
|
|
139
97
|
export declare const formatDescribedCol: (data: DescribeCollectionResponse) => DescribeCollectionResponse;
|
|
140
|
-
/**
|
|
141
|
-
* Builds a dynamic row object by separating the input data into non-dynamic fields and a dynamic field.
|
|
142
|
-
*
|
|
143
|
-
* @param {RowData} rowData - The input data object.
|
|
144
|
-
* @param {Map<string, Field>} fieldMap - A map of field names to field objects.
|
|
145
|
-
* @param {string} dynamicFieldName - The name of the dynamic field.
|
|
146
|
-
* @returns {RowData} The generated dynamic row object.
|
|
147
|
-
*/
|
|
148
|
-
export declare const buildDynamicRow: (rowData: RowData, fieldMap: Map<string, _Field>, dynamicFieldName: string, functionOutputFields: string[]) => RowData;
|
|
149
|
-
/**
|
|
150
|
-
* create a data map for each fields, resolve grpc data format
|
|
151
|
-
* If the field is a vector, split the data into chunks of the appropriate size.
|
|
152
|
-
* If the field is a scalar, decode the JSON/array data if necessary.
|
|
153
|
-
*/
|
|
154
|
-
export declare const buildFieldDataMap: (fields_data: any[], transformers?: OutputTransformers) => Map<string, RowData[]>;
|
|
155
|
-
/**
|
|
156
|
-
* Generates an authentication string based on the provided credentials.
|
|
157
|
-
*
|
|
158
|
-
* @param {Object} data - An object containing the authentication credentials.
|
|
159
|
-
* @param {string} [data.username] - The username to use for authentication.
|
|
160
|
-
* @param {string} [data.password] - The password to use for authentication.
|
|
161
|
-
* @param {string} [data.token] - The token to use for authentication.
|
|
162
|
-
* @returns {string} The authentication string.
|
|
163
|
-
*/
|
|
164
|
-
export declare const getAuthString: (data: {
|
|
165
|
-
username?: string;
|
|
166
|
-
password?: string;
|
|
167
|
-
token?: string;
|
|
168
|
-
}) => string;
|
|
169
|
-
/**
|
|
170
|
-
* Builds the field data for a given row and column.
|
|
171
|
-
*
|
|
172
|
-
* @param {RowData} rowData - The data for the row.
|
|
173
|
-
* @param {Field} column - The column information.
|
|
174
|
-
* @returns {FieldData} The field data for the row and column.
|
|
175
|
-
*/
|
|
176
|
-
export declare const buildFieldData: (rowData: RowData, field: _Field, transformers?: InsertTransformers) => FieldData;
|
|
177
|
-
/**
|
|
178
|
-
* Builds search parameters based on the provided data.
|
|
179
|
-
* @param data - The data object containing search parameters.
|
|
180
|
-
* @returns The search parameters in key-value format.
|
|
181
|
-
*/
|
|
182
|
-
export declare const buildSearchParams: (data: SearchSimpleReq | (HybridSearchSingleReq & HybridSearchReq), anns_field: string) => SearchParam;
|
|
183
|
-
/**
|
|
184
|
-
* Creates a RRFRanker object with the specified value of k.
|
|
185
|
-
* @param k - The value of k used in the RRFRanker strategy.
|
|
186
|
-
* @returns An object representing the RRFRanker strategy with the specified value of k.
|
|
187
|
-
*/
|
|
188
|
-
export declare const RRFRanker: (k?: number) => RerankerObj;
|
|
189
|
-
/**
|
|
190
|
-
* Creates a weighted ranker object.
|
|
191
|
-
* @param weights - An array of numbers representing the weights.
|
|
192
|
-
* @returns The weighted ranker object.
|
|
193
|
-
*/
|
|
194
|
-
export declare const WeightedRanker: (weights: number[]) => RerankerObj;
|
|
195
|
-
/**
|
|
196
|
-
* Converts the rerank parameters object to a format suitable for API requests.
|
|
197
|
-
* @param rerank - The rerank parameters object.
|
|
198
|
-
* @returns The converted rerank parameters object.
|
|
199
|
-
*/
|
|
200
|
-
export declare const convertRerankParams: (rerank: RerankerObj) => any;
|
|
201
|
-
type FormatedSearchRequest = {
|
|
202
|
-
collection_name: string;
|
|
203
|
-
partition_names: string[];
|
|
204
|
-
output_fields: string[];
|
|
205
|
-
nq?: number;
|
|
206
|
-
dsl?: string;
|
|
207
|
-
dsl_type?: DslType;
|
|
208
|
-
placeholder_group?: Uint8Array;
|
|
209
|
-
search_params?: KeyValuePair[];
|
|
210
|
-
consistency_level: ConsistencyLevelEnum;
|
|
211
|
-
expr?: string;
|
|
212
|
-
expr_template_values?: keyValueObj;
|
|
213
|
-
rank_params?: KeyValuePair[];
|
|
214
|
-
function_score?: any;
|
|
215
|
-
requests?: FormatedSearchRequest[];
|
|
216
|
-
};
|
|
217
|
-
/**
|
|
218
|
-
* This method is used to build search request for a given data.
|
|
219
|
-
* It first fetches the collection info and then constructs the search request based on the data type.
|
|
220
|
-
* It also creates search vectors and a placeholder group for the search.
|
|
221
|
-
*
|
|
222
|
-
* @param {SearchReq | SearchSimpleReq | HybridSearchReq} data - The data for which to build the search request.
|
|
223
|
-
* @param {DescribeCollectionResponse} collectionInfo - The collection information.
|
|
224
|
-
* @param {Root} milvusProto - The milvus protocol object.
|
|
225
|
-
* @returns {Object} An object containing the search requests and search vectors.
|
|
226
|
-
* @returns {Object} return.params - The search requests used in the operation.
|
|
227
|
-
* @returns {string} return.params.collection_name - The name of the collection.
|
|
228
|
-
* @returns {string[]} return.params.partition_names - The partition names.
|
|
229
|
-
* @returns {string[]} return.params.output_fields - The output fields.
|
|
230
|
-
* @returns {number} return.params.nq - The number of query vectors.
|
|
231
|
-
* @returns {string} return.params.dsl - The domain specific language.
|
|
232
|
-
* @returns {string} return.params.dsl_type - The type of the domain specific language.
|
|
233
|
-
* @returns {Uint8Array} return.params.placeholder_group - The placeholder group.
|
|
234
|
-
* @returns {Object} return.params.search_params - The search parameters.
|
|
235
|
-
* @returns {string} return.params.consistency_level - The consistency level.
|
|
236
|
-
* @returns {Number[][]} return.searchVectors - The search vectors used in the operation.
|
|
237
|
-
* @returns {number} return.round_decimal - The score precision.
|
|
238
|
-
*/
|
|
239
|
-
export declare const buildSearchRequest: (params: SearchReq | SearchSimpleReq | HybridSearchReq, collectionInfo: DescribeCollectionResponse, milvusProto: Root) => {
|
|
240
|
-
nq: number | undefined;
|
|
241
|
-
round_decimal?: number | undefined;
|
|
242
|
-
isHybridSearch: boolean;
|
|
243
|
-
request: FormatedSearchRequest | {
|
|
244
|
-
rank_params: KeyValuePair<string, string | number>[];
|
|
245
|
-
function_score?: undefined;
|
|
246
|
-
collection_name: string;
|
|
247
|
-
partition_names: string[] | undefined;
|
|
248
|
-
requests: FormatedSearchRequest[];
|
|
249
|
-
output_fields: string[];
|
|
250
|
-
consistency_level: ConsistencyLevelEnum;
|
|
251
|
-
} | {
|
|
252
|
-
rank_params: KeyValuePair<string, string | number>[];
|
|
253
|
-
function_score: {
|
|
254
|
-
functions: {
|
|
255
|
-
input_field_names: string[];
|
|
256
|
-
output_field_names: string[];
|
|
257
|
-
params: KeyValuePair<string, string | number>[];
|
|
258
|
-
name: string;
|
|
259
|
-
description?: string | undefined;
|
|
260
|
-
type: import("../").FunctionType;
|
|
261
|
-
}[];
|
|
262
|
-
params: never[];
|
|
263
|
-
};
|
|
264
|
-
collection_name: string;
|
|
265
|
-
partition_names: string[] | undefined;
|
|
266
|
-
requests: FormatedSearchRequest[];
|
|
267
|
-
output_fields: string[];
|
|
268
|
-
consistency_level: ConsistencyLevelEnum;
|
|
269
|
-
};
|
|
270
|
-
};
|
|
271
|
-
/**
|
|
272
|
-
* Formats the search results returned by Milvus into row data for easier use.
|
|
273
|
-
*
|
|
274
|
-
* @param {SearchRes} searchRes - The search results returned by Milvus.
|
|
275
|
-
* @param {Object} options - The options for formatting the search results.
|
|
276
|
-
* @param {number} options.round_decimal - The number of decimal places to which to round the scores.
|
|
277
|
-
*
|
|
278
|
-
* @returns {any[]} The formatted search results.
|
|
279
|
-
*
|
|
280
|
-
*/
|
|
281
|
-
export declare const formatSearchResult: (searchRes: SearchRes, options: {
|
|
282
|
-
round_decimal: number;
|
|
283
|
-
transformers?: OutputTransformers;
|
|
284
|
-
}) => any[];
|
|
285
|
-
/**
|
|
286
|
-
* Formats the search vector to match a specific data type.
|
|
287
|
-
* @param {SearchDataType[]} searchVector - The search vector or array of vectors to be formatted.
|
|
288
|
-
* @param {DataType} dataType - The specified data type.
|
|
289
|
-
* @returns {VectorTypes[]} The formatted search vector or array of vectors.
|
|
290
|
-
*/
|
|
291
|
-
export declare const formatSearchData: (searchData: SearchDataType | SearchMultipleDataType, field: FieldSchema) => SearchMultipleDataType;
|
|
292
|
-
type TemplateValue = {
|
|
293
|
-
bool_val: boolean;
|
|
294
|
-
} | {
|
|
295
|
-
int64_val: number;
|
|
296
|
-
} | {
|
|
297
|
-
float_val: number;
|
|
298
|
-
} | {
|
|
299
|
-
string_val: string;
|
|
300
|
-
} | {
|
|
301
|
-
array_val: TemplateArrayValue;
|
|
302
|
-
};
|
|
303
|
-
type TemplateArrayValue = {
|
|
304
|
-
bool_data: {
|
|
305
|
-
data: boolean[];
|
|
306
|
-
};
|
|
307
|
-
} | {
|
|
308
|
-
long_data: {
|
|
309
|
-
data: number[];
|
|
310
|
-
};
|
|
311
|
-
} | {
|
|
312
|
-
double_data: {
|
|
313
|
-
data: number[];
|
|
314
|
-
};
|
|
315
|
-
} | {
|
|
316
|
-
string_data: {
|
|
317
|
-
data: string[];
|
|
318
|
-
};
|
|
319
|
-
} | {
|
|
320
|
-
json_data: {
|
|
321
|
-
data: any[];
|
|
322
|
-
};
|
|
323
|
-
} | {
|
|
324
|
-
array_data: {
|
|
325
|
-
data: TemplateArrayValue[];
|
|
326
|
-
};
|
|
327
|
-
};
|
|
328
|
-
export declare const formatExprValues: (exprValues: Record<string, any>) => Record<string, TemplateValue>;
|
|
329
|
-
export {};
|