@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,66 @@
|
|
|
1
|
+
import { GrpcTimeOut, KeyValuePair, DataType, ImportState, collectionNameReq, resStatusResponse, Bool, Int8, Int16, Int32, Int64, Float, Double, VarChar, JSON, Geometry, Array, VectorTypes, BFloat16Vector, Float16Vector } from '../';
|
|
2
|
+
export type FieldData = Bool | Int8 | Int16 | Int32 | Int64 | Float | Double | VarChar | JSON | Geometry | Array | VectorTypes | null | undefined;
|
|
3
|
+
export interface RowData {
|
|
4
|
+
[x: string]: FieldData;
|
|
5
|
+
}
|
|
6
|
+
export interface _Field {
|
|
7
|
+
name: string;
|
|
8
|
+
type: DataType;
|
|
9
|
+
elementType?: DataType;
|
|
10
|
+
data: FieldData[];
|
|
11
|
+
dim?: number;
|
|
12
|
+
nullable?: boolean;
|
|
13
|
+
default_value?: FieldData;
|
|
14
|
+
fieldMap: Map<string, _Field>;
|
|
15
|
+
}
|
|
16
|
+
export type InsertTransformers = {
|
|
17
|
+
[DataType.BFloat16Vector]?: (bf16: BFloat16Vector) => Uint8Array;
|
|
18
|
+
[DataType.Float16Vector]?: (f16: Float16Vector) => Uint8Array;
|
|
19
|
+
};
|
|
20
|
+
interface BaseInsertReq extends collectionNameReq {
|
|
21
|
+
partition_name?: string;
|
|
22
|
+
hash_keys?: number[];
|
|
23
|
+
transformers?: InsertTransformers;
|
|
24
|
+
skip_check_schema?: boolean;
|
|
25
|
+
}
|
|
26
|
+
export type InsertReq = DataInsertReq | FieldsDataInsertReq;
|
|
27
|
+
export type UpsertReq = (DataInsertReq | FieldsDataInsertReq) & {
|
|
28
|
+
partial_update?: boolean;
|
|
29
|
+
};
|
|
30
|
+
interface DataInsertReq extends BaseInsertReq {
|
|
31
|
+
data: RowData[];
|
|
32
|
+
fields_data?: never;
|
|
33
|
+
}
|
|
34
|
+
interface FieldsDataInsertReq extends BaseInsertReq {
|
|
35
|
+
fields_data: RowData[];
|
|
36
|
+
data?: never;
|
|
37
|
+
}
|
|
38
|
+
export interface ImportReq extends collectionNameReq {
|
|
39
|
+
partition_name?: string;
|
|
40
|
+
channel_names?: string[];
|
|
41
|
+
files: string[];
|
|
42
|
+
options?: KeyValuePair[];
|
|
43
|
+
}
|
|
44
|
+
export interface ListImportTasksReq extends collectionNameReq {
|
|
45
|
+
limit?: number;
|
|
46
|
+
}
|
|
47
|
+
export interface GetImportStateReq extends GrpcTimeOut {
|
|
48
|
+
task: number;
|
|
49
|
+
}
|
|
50
|
+
export interface ImportResponse extends resStatusResponse {
|
|
51
|
+
tasks: number[];
|
|
52
|
+
}
|
|
53
|
+
export interface GetImportStateResponse extends resStatusResponse {
|
|
54
|
+
state: ImportState;
|
|
55
|
+
row_count: number;
|
|
56
|
+
id_list: number[];
|
|
57
|
+
infos: KeyValuePair[];
|
|
58
|
+
id: number;
|
|
59
|
+
collection_id: number;
|
|
60
|
+
segment_ids: number[];
|
|
61
|
+
create_ts: number;
|
|
62
|
+
}
|
|
63
|
+
export interface ListImportTasksResponse extends resStatusResponse {
|
|
64
|
+
tasks: GetImportStateResponse[];
|
|
65
|
+
}
|
|
66
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Insert.js","sourceRoot":"","sources":["../../../milvus/types/Insert.ts"],"names":[],"mappings":";;AAAA,2BAqBa"}
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { keyValueObj, DataType, ConsistencyLevelEnum, collectionNameReq, resStatusResponse, RANKER_TYPE, FunctionObject, VectorTypes, BFloat16Vector, Float16Vector, SparseVectorDic, SparseFloatVector, Int8Vector } from '../';
|
|
3
|
+
export interface SearchParam {
|
|
4
|
+
anns_field: string;
|
|
5
|
+
topk: string | number;
|
|
6
|
+
metric_type: string;
|
|
7
|
+
params: string;
|
|
8
|
+
offset?: number;
|
|
9
|
+
round_decimal?: number;
|
|
10
|
+
ignore_growing?: boolean;
|
|
11
|
+
group_by_field?: string;
|
|
12
|
+
group_size?: number;
|
|
13
|
+
strict_group_size?: boolean;
|
|
14
|
+
hints?: string;
|
|
15
|
+
[key: string]: any;
|
|
16
|
+
}
|
|
17
|
+
export type SearchText = string;
|
|
18
|
+
export type SearchEmbList = VectorTypes[];
|
|
19
|
+
export type SearchVector = VectorTypes;
|
|
20
|
+
export type SearchData = SearchVector | SearchText | SearchEmbList;
|
|
21
|
+
export interface SearchReq extends collectionNameReq {
|
|
22
|
+
anns_field?: string;
|
|
23
|
+
partition_names?: string[];
|
|
24
|
+
expr?: string;
|
|
25
|
+
exprValues?: keyValueObj;
|
|
26
|
+
search_params: SearchParam;
|
|
27
|
+
vectors: SearchData | SearchData[];
|
|
28
|
+
output_fields?: string[];
|
|
29
|
+
travel_timestamp?: string;
|
|
30
|
+
vector_type: DataType.BinaryVector | DataType.FloatVector;
|
|
31
|
+
nq?: number;
|
|
32
|
+
consistency_level?: ConsistencyLevelEnum;
|
|
33
|
+
transformers?: OutputTransformers;
|
|
34
|
+
}
|
|
35
|
+
export interface FunctionScore {
|
|
36
|
+
functions: FunctionObject[];
|
|
37
|
+
params: keyValueObj;
|
|
38
|
+
}
|
|
39
|
+
export interface SearchSimpleReq extends collectionNameReq {
|
|
40
|
+
partition_names?: string[];
|
|
41
|
+
anns_field?: string;
|
|
42
|
+
data: SearchData | SearchData[];
|
|
43
|
+
vector?: SearchData | SearchData[];
|
|
44
|
+
output_fields?: string[];
|
|
45
|
+
limit?: number;
|
|
46
|
+
topk?: number;
|
|
47
|
+
offset?: number;
|
|
48
|
+
filter?: string;
|
|
49
|
+
expr?: string;
|
|
50
|
+
exprValues?: keyValueObj;
|
|
51
|
+
params?: keyValueObj;
|
|
52
|
+
metric_type?: string;
|
|
53
|
+
consistency_level?: ConsistencyLevelEnum;
|
|
54
|
+
ignore_growing?: boolean;
|
|
55
|
+
group_by_field?: string;
|
|
56
|
+
group_size?: number;
|
|
57
|
+
strict_group_size?: boolean;
|
|
58
|
+
hints?: string;
|
|
59
|
+
round_decimal?: number;
|
|
60
|
+
transformers?: OutputTransformers;
|
|
61
|
+
rerank?: RerankerObj | FunctionObject | FunctionScore;
|
|
62
|
+
nq?: number;
|
|
63
|
+
}
|
|
64
|
+
export type HybridSearchSingleReq = Pick<SearchParam, 'anns_field' | 'ignore_growing' | 'group_by_field'> & {
|
|
65
|
+
data: SearchData;
|
|
66
|
+
expr?: string;
|
|
67
|
+
exprValues?: keyValueObj;
|
|
68
|
+
params?: keyValueObj;
|
|
69
|
+
transformers?: OutputTransformers;
|
|
70
|
+
};
|
|
71
|
+
export interface SearchIteratorReq extends Omit<SearchSimpleReq, 'vectors' | 'offset' | 'limit' | 'topk'> {
|
|
72
|
+
limit?: number;
|
|
73
|
+
batchSize: number;
|
|
74
|
+
external_filter_fn?: (row: SearchResultData) => boolean;
|
|
75
|
+
}
|
|
76
|
+
export type RerankerObj = {
|
|
77
|
+
strategy: RANKER_TYPE | string;
|
|
78
|
+
params: keyValueObj;
|
|
79
|
+
};
|
|
80
|
+
export type HybridSearchReq = Omit<SearchSimpleReq, 'data' | 'vector' | 'vectors' | 'anns_field' | 'expr' | 'exprValues'> & {
|
|
81
|
+
data: HybridSearchSingleReq[];
|
|
82
|
+
rerank?: RerankerObj | FunctionObject | FunctionScore;
|
|
83
|
+
};
|
|
84
|
+
export interface SearchRes extends resStatusResponse {
|
|
85
|
+
results: {
|
|
86
|
+
top_k: number;
|
|
87
|
+
fields_data: {
|
|
88
|
+
type: string;
|
|
89
|
+
field_name: string;
|
|
90
|
+
field_id: number;
|
|
91
|
+
field: 'vectors' | 'scalars';
|
|
92
|
+
vectors?: {
|
|
93
|
+
dim: string;
|
|
94
|
+
data: 'float_vector' | 'binary_vector';
|
|
95
|
+
float_vector?: {
|
|
96
|
+
data: number[];
|
|
97
|
+
};
|
|
98
|
+
binary_vector?: Buffer;
|
|
99
|
+
};
|
|
100
|
+
scalars: {
|
|
101
|
+
[x: string]: any;
|
|
102
|
+
data: string;
|
|
103
|
+
};
|
|
104
|
+
}[];
|
|
105
|
+
scores: number[];
|
|
106
|
+
ids: {
|
|
107
|
+
int_id?: {
|
|
108
|
+
data: number[];
|
|
109
|
+
};
|
|
110
|
+
str_id?: {
|
|
111
|
+
data: string[];
|
|
112
|
+
};
|
|
113
|
+
id_field: 'int_id' | 'str_id';
|
|
114
|
+
};
|
|
115
|
+
num_queries: number;
|
|
116
|
+
topks: number[];
|
|
117
|
+
output_fields: string[];
|
|
118
|
+
group_by_field_value: string;
|
|
119
|
+
recalls: number[];
|
|
120
|
+
search_iterator_v2_results?: Record<string, any>;
|
|
121
|
+
_search_iterator_v2_results?: string;
|
|
122
|
+
all_search_count?: number;
|
|
123
|
+
};
|
|
124
|
+
collection_name: string;
|
|
125
|
+
session_ts: number;
|
|
126
|
+
}
|
|
127
|
+
export type OutputTransformers = {
|
|
128
|
+
[DataType.BFloat16Vector]?: (bf16bytes: Uint8Array) => BFloat16Vector;
|
|
129
|
+
[DataType.Float16Vector]?: (f16: Uint8Array) => Float16Vector;
|
|
130
|
+
[DataType.SparseFloatVector]?: (sparse: SparseVectorDic) => SparseFloatVector;
|
|
131
|
+
[DataType.Int8Vector]?: (int8Vector: Int8Array) => Int8Vector;
|
|
132
|
+
};
|
|
133
|
+
export type DetermineResultsType<T extends Record<string, any>> = T['vectors'] extends [SearchData] ? SearchResultData[] : T['vectors'] extends SearchData[] ? SearchResultData[][] : T['vector'] extends SearchData ? SearchResultData[] : T['data'] extends SearchData ? SearchResultData[] : T['data'] extends SearchData[] ? SearchResultData[][] : SearchResultData[];
|
|
134
|
+
export interface SearchResultData {
|
|
135
|
+
[x: string]: any;
|
|
136
|
+
score: number;
|
|
137
|
+
id: string;
|
|
138
|
+
}
|
|
139
|
+
export interface SearchResults<T extends SearchReq | SearchSimpleReq | HybridSearchReq> extends resStatusResponse {
|
|
140
|
+
results: DetermineResultsType<T>;
|
|
141
|
+
recalls: number[];
|
|
142
|
+
session_ts: number;
|
|
143
|
+
collection_name: string;
|
|
144
|
+
all_search_count?: number;
|
|
145
|
+
search_iterator_v2_results?: Record<string, any>;
|
|
146
|
+
_search_iterator_v2_results?: string;
|
|
147
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Search.js","sourceRoot":"","sources":["../../../milvus/types/Search.ts"],"names":[],"mappings":";;AAAA,2BAca"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { SegmentState, SegmentLevel } from '../const';
|
|
2
|
+
import { resStatusResponse, collectionNameReq, GrpcTimeOut } from './Common';
|
|
3
|
+
export interface GetFlushStateReq extends GrpcTimeOut {
|
|
4
|
+
segmentIDs: number[];
|
|
5
|
+
}
|
|
6
|
+
export interface FlushReq extends GrpcTimeOut {
|
|
7
|
+
collection_names: string[];
|
|
8
|
+
db_name?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface FlushResult extends resStatusResponse {
|
|
11
|
+
coll_segIDs: any;
|
|
12
|
+
}
|
|
13
|
+
export interface GetFlushStateResponse extends resStatusResponse {
|
|
14
|
+
flushed: boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface QuerySegmentInfo {
|
|
17
|
+
segmentID: number;
|
|
18
|
+
collectionID: number;
|
|
19
|
+
partitionID: number;
|
|
20
|
+
mem_size: number;
|
|
21
|
+
num_rows: number;
|
|
22
|
+
index_name: string;
|
|
23
|
+
indexID: number;
|
|
24
|
+
nodeID: number;
|
|
25
|
+
state: SegmentState;
|
|
26
|
+
nodeIds: number[];
|
|
27
|
+
level: SegmentLevel;
|
|
28
|
+
}
|
|
29
|
+
export interface GetQuerySegmentInfoResponse extends resStatusResponse {
|
|
30
|
+
infos: QuerySegmentInfo[];
|
|
31
|
+
}
|
|
32
|
+
export interface PersistentSegmentInfo {
|
|
33
|
+
segmentID: number;
|
|
34
|
+
collectionID: number;
|
|
35
|
+
partitionID: number;
|
|
36
|
+
num_rows: number;
|
|
37
|
+
state: SegmentState;
|
|
38
|
+
}
|
|
39
|
+
export interface GePersistentSegmentInfoResponse extends resStatusResponse {
|
|
40
|
+
infos: PersistentSegmentInfo[];
|
|
41
|
+
}
|
|
42
|
+
export interface ListIndexedSegmentReq extends collectionNameReq {
|
|
43
|
+
index_name: string;
|
|
44
|
+
}
|
|
45
|
+
export interface ListIndexedSegmentResponse extends resStatusResponse {
|
|
46
|
+
segmentIDs: number[];
|
|
47
|
+
}
|
|
48
|
+
export interface DescribeSegmentIndexDataReq extends collectionNameReq {
|
|
49
|
+
index_name: string;
|
|
50
|
+
segmentsIDs: number[];
|
|
51
|
+
}
|
|
52
|
+
export interface DescribeSegmentIndexDataResponse extends resStatusResponse {
|
|
53
|
+
index_params: any;
|
|
54
|
+
index_data: any;
|
|
55
|
+
}
|
|
56
|
+
export interface GetQuerySegmentInfoReq extends GrpcTimeOut {
|
|
57
|
+
collectionName: string;
|
|
58
|
+
dbName?: string;
|
|
59
|
+
}
|
|
60
|
+
export interface GePersistentSegmentInfoReq extends GrpcTimeOut {
|
|
61
|
+
collectionName: string;
|
|
62
|
+
dbName?: string;
|
|
63
|
+
}
|
|
64
|
+
export interface LoadBalanceReq extends GrpcTimeOut {
|
|
65
|
+
src_nodeID: number;
|
|
66
|
+
dst_nodeIDs?: number[];
|
|
67
|
+
sealed_segmentIDs?: number[];
|
|
68
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Segments.js","sourceRoot":"","sources":["../../../milvus/types/Segments.ts"],"names":[],"mappings":""}
|
|
@@ -28,4 +28,8 @@ __exportStar(require("./Client"), exports);
|
|
|
28
28
|
__exportStar(require("./MilvusIndex"), exports);
|
|
29
29
|
__exportStar(require("./HighLevel"), exports);
|
|
30
30
|
__exportStar(require("./Http"), exports);
|
|
31
|
+
__exportStar(require("./Segments"), exports);
|
|
32
|
+
__exportStar(require("./Insert"), exports);
|
|
33
|
+
__exportStar(require("./Search"), exports);
|
|
34
|
+
__exportStar(require("./DataTypes"), exports);
|
|
31
35
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../milvus/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,eAAe;AACf,6CAA2B;AAC3B,+CAA6B;AAC7B,yCAAuB;AACvB,2CAAyB;AACzB,gDAA8B;AAC9B,8CAA4B;AAC5B,6CAA2B;AAC3B,yCAAuB;AACvB,6CAA2B;AAC3B,2CAAyB;AACzB,gDAA8B;AAC9B,8CAA4B;AAC5B,yCAAuB"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../milvus/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,eAAe;AACf,6CAA2B;AAC3B,+CAA6B;AAC7B,yCAAuB;AACvB,2CAAyB;AACzB,gDAA8B;AAC9B,8CAA4B;AAC5B,6CAA2B;AAC3B,yCAAuB;AACvB,6CAA2B;AAC3B,2CAAyB;AACzB,gDAA8B;AAC9B,8CAA4B;AAC5B,yCAAuB;AACvB,6CAA2B;AAC3B,2CAAyB;AACzB,2CAAyB;AACzB,8CAA4B"}
|
package/dist/milvus/types.d.ts
CHANGED
|
@@ -10,3 +10,7 @@ export * from './types/Resource';
|
|
|
10
10
|
export * from './types/Client';
|
|
11
11
|
export * from './types/HighLevel';
|
|
12
12
|
export * from './types/Http';
|
|
13
|
+
export * from './types/Segments';
|
|
14
|
+
export * from './types/Insert';
|
|
15
|
+
export * from './types/Search';
|
|
16
|
+
export * from './types/DataTypes';
|
package/dist/milvus/types.js
CHANGED
|
@@ -14,7 +14,6 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
// @deprecated
|
|
18
17
|
__exportStar(require("./types/Database"), exports);
|
|
19
18
|
__exportStar(require("./types/Collection"), exports);
|
|
20
19
|
__exportStar(require("./types/Data"), exports);
|
|
@@ -27,4 +26,8 @@ __exportStar(require("./types/Resource"), exports);
|
|
|
27
26
|
__exportStar(require("./types/Client"), exports);
|
|
28
27
|
__exportStar(require("./types/HighLevel"), exports);
|
|
29
28
|
__exportStar(require("./types/Http"), exports);
|
|
29
|
+
__exportStar(require("./types/Segments"), exports);
|
|
30
|
+
__exportStar(require("./types/Insert"), exports);
|
|
31
|
+
__exportStar(require("./types/Search"), exports);
|
|
32
|
+
__exportStar(require("./types/DataTypes"), exports);
|
|
30
33
|
//# sourceMappingURL=types.js.map
|
package/dist/milvus/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../milvus/types.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../milvus/types.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAAiC;AACjC,qDAAmC;AACnC,+CAA6B;AAC7B,iDAA+B;AAC/B,sDAAoC;AACpC,oDAAkC;AAClC,mDAAiC;AACjC,+CAA6B;AAC7B,mDAAiC;AACjC,iDAA+B;AAC/B,oDAAkC;AAClC,+CAA6B;AAC7B,mDAAiC;AACjC,iDAA+B;AAC/B,iDAA+B;AAC/B,oDAAkC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { Root } from 'protobufjs';
|
|
3
|
-
import { FloatVector, BinaryVector, SparseFloatVector, Int8Vector,
|
|
3
|
+
import { FloatVector, BinaryVector, SparseFloatVector, Int8Vector, Float16Vector, BFloat16Vector, FieldSchema, SearchData } from '..';
|
|
4
4
|
/**
|
|
5
5
|
* Converts a float vector into bytes format.
|
|
6
6
|
*
|
|
@@ -21,7 +21,7 @@ export declare const f32ArrayToBinaryBytes: (array: BinaryVector) => Buffer;
|
|
|
21
21
|
* @param {Float16Vector} array - The float16 vector(f32 format) to convert.
|
|
22
22
|
* @returns {Buffer} Bytes representing the float16 vector.
|
|
23
23
|
*/
|
|
24
|
-
export declare const f32ArrayToF16Bytes: (array: Float16Vector) =>
|
|
24
|
+
export declare const f32ArrayToF16Bytes: (array: Float16Vector) => Uint8Array;
|
|
25
25
|
/**
|
|
26
26
|
* Convert float16 bytes to float32 array.
|
|
27
27
|
* @param {Uint8Array} f16Bytes - The float16 bytes to convert.
|
|
@@ -33,7 +33,7 @@ export declare const f16BytesToF32Array: (f16Bytes: Uint8Array) => number[];
|
|
|
33
33
|
* @param {BFloat16Vector} array - The float32 array to convert.
|
|
34
34
|
* @returns {Buffer} The BFloat16 bytes.
|
|
35
35
|
*/
|
|
36
|
-
export declare const f32ArrayToBf16Bytes: (array: BFloat16Vector) =>
|
|
36
|
+
export declare const f32ArrayToBf16Bytes: (array: BFloat16Vector) => Uint8Array;
|
|
37
37
|
/**
|
|
38
38
|
* Convert BFloat16 bytes to Float32 array.
|
|
39
39
|
* @param {Uint8Array} bf16Bytes - The BFloat16 bytes to convert.
|
|
@@ -88,9 +88,9 @@ export declare const bytesToSparseRow: (bufferData: Buffer) => SparseFloatVector
|
|
|
88
88
|
* This function builds a placeholder group in bytes format for Milvus.
|
|
89
89
|
*
|
|
90
90
|
* @param {Root} milvusProto - The root object of the Milvus protocol.
|
|
91
|
-
* @param {
|
|
91
|
+
* @param {[SearchData] | SearchData[]} data - An array of search vectors.
|
|
92
92
|
* @param {DataType} vectorDataType - The data type of the vectors.
|
|
93
93
|
*
|
|
94
94
|
* @returns {Uint8Array} The placeholder group in bytes format.
|
|
95
95
|
*/
|
|
96
|
-
export declare const buildPlaceholderGroupBytes: (milvusProto: Root, data:
|
|
96
|
+
export declare const buildPlaceholderGroupBytes: (milvusProto: Root, data: [SearchData] | SearchData[], field: FieldSchema) => Uint8Array;
|
|
@@ -247,13 +247,13 @@ exports.bytesToSparseRow = bytesToSparseRow;
|
|
|
247
247
|
* This function builds a placeholder group in bytes format for Milvus.
|
|
248
248
|
*
|
|
249
249
|
* @param {Root} milvusProto - The root object of the Milvus protocol.
|
|
250
|
-
* @param {
|
|
250
|
+
* @param {[SearchData] | SearchData[]} data - An array of search vectors.
|
|
251
251
|
* @param {DataType} vectorDataType - The data type of the vectors.
|
|
252
252
|
*
|
|
253
253
|
* @returns {Uint8Array} The placeholder group in bytes format.
|
|
254
254
|
*/
|
|
255
255
|
const buildPlaceholderGroupBytes = (milvusProto, data, field) => {
|
|
256
|
-
const {
|
|
256
|
+
const { is_function_output, _placeholderType } = field;
|
|
257
257
|
// create placeholder_group value
|
|
258
258
|
let bytes;
|
|
259
259
|
if (is_function_output) {
|
|
@@ -262,23 +262,24 @@ const buildPlaceholderGroupBytes = (milvusProto, data, field) => {
|
|
|
262
262
|
}
|
|
263
263
|
else {
|
|
264
264
|
// parse vectors to bytes
|
|
265
|
-
switch (
|
|
266
|
-
case __1.
|
|
265
|
+
switch (_placeholderType) {
|
|
266
|
+
case __1.PlaceholderType.FloatVector:
|
|
267
|
+
case __1.PlaceholderType.EmbListFloatVector:
|
|
267
268
|
bytes = data.map(v => (0, exports.f32ArrayToF32Bytes)(v));
|
|
268
269
|
break;
|
|
269
|
-
case __1.
|
|
270
|
+
case __1.PlaceholderType.BinaryVector:
|
|
270
271
|
bytes = data.map(v => (0, exports.f32ArrayToBinaryBytes)(v));
|
|
271
272
|
break;
|
|
272
|
-
case __1.
|
|
273
|
+
case __1.PlaceholderType.BFloat16Vector:
|
|
273
274
|
bytes = data.map(v => Array.isArray(v) ? (0, exports.f32ArrayToBf16Bytes)(v) : v);
|
|
274
275
|
break;
|
|
275
|
-
case __1.
|
|
276
|
+
case __1.PlaceholderType.Float16Vector:
|
|
276
277
|
bytes = data.map(v => Array.isArray(v) ? (0, exports.f32ArrayToF16Bytes)(v) : v);
|
|
277
278
|
break;
|
|
278
|
-
case __1.
|
|
279
|
+
case __1.PlaceholderType.Int8Vector:
|
|
279
280
|
bytes = data.map(v => Array.isArray(v) ? (0, exports.f32ArrayToInt8Bytes)(v) : v);
|
|
280
281
|
break;
|
|
281
|
-
case __1.
|
|
282
|
+
case __1.PlaceholderType.SparseFloatVector:
|
|
282
283
|
bytes = data.map(v => (0, exports.sparseToBytes)(v));
|
|
283
284
|
break;
|
|
284
285
|
}
|
|
@@ -290,7 +291,7 @@ const buildPlaceholderGroupBytes = (milvusProto, data, field) => {
|
|
|
290
291
|
placeholders: [
|
|
291
292
|
{
|
|
292
293
|
tag: '$0',
|
|
293
|
-
type:
|
|
294
|
+
type: _placeholderType,
|
|
294
295
|
values: bytes,
|
|
295
296
|
},
|
|
296
297
|
],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Bytes.js","sourceRoot":"","sources":["../../../milvus/utils/Bytes.ts"],"names":[],"mappings":";;;AACA,kDAAoD;AACpD,0BAaY;AAEZ;;;;;GAKG;AACI,MAAM,kBAAkB,GAAG,CAAC,KAAkB,EAAE,EAAE;IACvD,sBAAsB;IACtB,MAAM,CAAC,GAAG,IAAI,YAAY,CAAC,KAAK,CAAC,CAAC;IAClC,oCAAoC;IACpC,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;AAC/B,CAAC,CAAC;AALW,QAAA,kBAAkB,sBAK7B;AAEF;;;;;GAKG;AACI,MAAM,qBAAqB,GAAG,CAAC,KAAmB,EAAE,EAAE;IAC3D,MAAM,CAAC,GAAG,IAAI,UAAU,CAAC,KAAK,CAAC,CAAC;IAChC,oCAAoC;IACpC,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;AAC/B,CAAC,CAAC;AAJW,QAAA,qBAAqB,yBAIhC;AAEF;;;;;GAKG;AACI,MAAM,kBAAkB,GAAG,CAAC,KAAoB,EAAE,EAAE;IACzD,MAAM,YAAY,GAAG,IAAI,sBAAY,CAAC,KAAK,CAAC,CAAC;IAC7C,OAAO,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"Bytes.js","sourceRoot":"","sources":["../../../milvus/utils/Bytes.ts"],"names":[],"mappings":";;;AACA,kDAAoD;AACpD,0BAaY;AAEZ;;;;;GAKG;AACI,MAAM,kBAAkB,GAAG,CAAC,KAAkB,EAAE,EAA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AI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CACnB,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAA,0BAAkB,EAAC,CAAkB,CAAC,CAAC,CAAC,CAAC,CAAC,CAC9D,CAAC;gBACF,MAAM;YAER,KAAK,mBAAe,CAAC,UAAU;gBAC7B,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CACnB,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAA,2BAAmB,EAAC,CAAe,CAAC,CAAC,CAAC,CAAC,CAAC,CAC5D,CAAC;gBACF,MAAM;YAER,KAAK,mBAAe,CAAC,iBAAiB;gBACpC,KAAK,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,IAAA,qBAAa,EAAC,CAAsB,CAAC,CAAC,CAAC;gBAC7D,MAAM;SACT;KACF;IAED,2BAA2B;IAC3B,MAAM,gBAAgB,GAAG,WAAW,CAAC,UAAU,CAC7C,sCAAsC,CACvC,CAAC;IACF,sDAAsD;IACtD,MAAM,qBAAqB,GAAG,gBAAgB,CAAC,MAAM,CACnD,gBAAgB,CAAC,MAAM,CAAC;QACtB,YAAY,EAAE;YACZ;gBACE,GAAG,EAAE,IAAI;gBACT,IAAI,EAAE,gBAAgB;gBACtB,MAAM,EAAE,KAAK;aACd;SACF;KACF,CAAC,CACH,CAAC,MAAM,EAAE,CAAC;IAEX,OAAO,qBAAqB,CAAC;AAC/B,CAAC,CAAC;AAlEW,QAAA,0BAA0B,8BAkErC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generates an authentication string based on the provided credentials.
|
|
3
|
+
*
|
|
4
|
+
* @param {Object} data - An object containing the authentication credentials.
|
|
5
|
+
* @param {string} [data.username] - The username to use for authentication.
|
|
6
|
+
* @param {string} [data.password] - The password to use for authentication.
|
|
7
|
+
* @param {string} [data.token] - The token to use for authentication.
|
|
8
|
+
* @returns {string} The authentication string.
|
|
9
|
+
*/
|
|
10
|
+
export declare const getAuthString: (data: {
|
|
11
|
+
username?: string;
|
|
12
|
+
password?: string;
|
|
13
|
+
token?: string;
|
|
14
|
+
}) => string;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getAuthString = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Generates an authentication string based on the provided credentials.
|
|
6
|
+
*
|
|
7
|
+
* @param {Object} data - An object containing the authentication credentials.
|
|
8
|
+
* @param {string} [data.username] - The username to use for authentication.
|
|
9
|
+
* @param {string} [data.password] - The password to use for authentication.
|
|
10
|
+
* @param {string} [data.token] - The token to use for authentication.
|
|
11
|
+
* @returns {string} The authentication string.
|
|
12
|
+
*/
|
|
13
|
+
const getAuthString = (data) => {
|
|
14
|
+
const { username, password, token } = data;
|
|
15
|
+
// build auth string
|
|
16
|
+
const authString = token ? token : `${username}:${password}`;
|
|
17
|
+
// Encode the username and password as a base64 string.
|
|
18
|
+
let auth = Buffer.from(authString, 'utf-8').toString('base64');
|
|
19
|
+
// if we need to create auth interceptors
|
|
20
|
+
const needAuth = (!!username && !!password) || !!token;
|
|
21
|
+
return needAuth ? auth : '';
|
|
22
|
+
};
|
|
23
|
+
exports.getAuthString = getAuthString;
|
|
24
|
+
//# sourceMappingURL=Connection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Connection.js","sourceRoot":"","sources":["../../../milvus/utils/Connection.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;GAQG;AACI,MAAM,aAAa,GAAG,CAAC,IAI7B,EAAE,EAAE;IACH,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC;IAC3C,oBAAoB;IACpB,MAAM,UAAU,GAAG,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,QAAQ,IAAI,QAAQ,EAAE,CAAC;IAC7D,uDAAuD;IACvD,IAAI,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAE/D,yCAAyC;IACzC,MAAM,QAAQ,GAAG,CAAC,CAAC,CAAC,QAAQ,IAAI,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC;IACvD,OAAO,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC;AAC9B,CAAC,CAAC;AAdW,QAAA,aAAa,iBAcxB"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { RowData, _Field, FieldData, InsertTransformers, OutputTransformers } from '../';
|
|
2
|
+
/**
|
|
3
|
+
* Builds a dynamic row object by separating the input data into non-dynamic fields and a dynamic field.
|
|
4
|
+
*
|
|
5
|
+
* @param {RowData} rowData - The input data object.
|
|
6
|
+
* @param {Map<string, Field>} fieldMap - A map of field names to field objects.
|
|
7
|
+
* @param {string} dynamicFieldName - The name of the dynamic field.
|
|
8
|
+
* @returns {RowData} The generated dynamic row object.
|
|
9
|
+
*/
|
|
10
|
+
export declare const buildDynamicRow: (rowData: RowData, fieldMap: Map<string, _Field>, dynamicFieldName: string, functionOutputFields: string[]) => RowData;
|
|
11
|
+
/**
|
|
12
|
+
* Processes vector data from gRPC response format
|
|
13
|
+
* @param item - The vector field item from gRPC response
|
|
14
|
+
* @param transformers - Optional transformers for data conversion
|
|
15
|
+
* @returns Processed vector data
|
|
16
|
+
*/
|
|
17
|
+
export declare const processVectorData: (item: any, transformers?: OutputTransformers) => any;
|
|
18
|
+
/**
|
|
19
|
+
* Processes scalar data from gRPC response format
|
|
20
|
+
* @param item - The scalar field item from gRPC response
|
|
21
|
+
* @returns Processed scalar data
|
|
22
|
+
*/
|
|
23
|
+
export declare const processScalarData: (item: any) => any;
|
|
24
|
+
/**
|
|
25
|
+
* Processes struct arrays data from gRPC response format
|
|
26
|
+
* @param item - The struct arrays field item from gRPC response
|
|
27
|
+
* @returns Processed struct arrays data as array of objects
|
|
28
|
+
*/
|
|
29
|
+
export declare const processStructArraysData: (item: any) => any;
|
|
30
|
+
/**
|
|
31
|
+
* create a data map for each fields, resolve grpc data format
|
|
32
|
+
* If the field is a vector, split the data into chunks of the appropriate size.
|
|
33
|
+
* If the field is a scalar, decode the JSON/array data if necessary.
|
|
34
|
+
*/
|
|
35
|
+
export declare const buildFieldDataMap: (fields_data: any[], transformers?: OutputTransformers) => Map<string, RowData[]>;
|
|
36
|
+
/**
|
|
37
|
+
* Builds the field data for a given row and column.
|
|
38
|
+
*
|
|
39
|
+
* @param {RowData} rowData - The data for the row.
|
|
40
|
+
* @param {Field} column - The column information.
|
|
41
|
+
* @returns {FieldData} The field data for the row and column.
|
|
42
|
+
*/
|
|
43
|
+
export declare const buildFieldData: (rowData: RowData, field: _Field, transformers?: InsertTransformers, rowIndex?: number) => FieldData;
|