@mastra/libsql 0.0.0-separate-trace-data-from-component-20250501141108 → 0.0.0-vector-query-sources-20250516172905
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/CHANGELOG.md +172 -2
- package/dist/_tsup-dts-rollup.d.cts +51 -28
- package/dist/_tsup-dts-rollup.d.ts +51 -28
- package/dist/index.cjs +344 -186
- package/dist/index.js +344 -186
- package/package.json +4 -4
- package/src/storage/index.ts +38 -10
- package/src/vector/index.test.ts +195 -117
- package/src/vector/index.ts +109 -24
- package/src/vector/sql-builder.ts +243 -175
package/CHANGELOG.md
CHANGED
|
@@ -1,13 +1,183 @@
|
|
|
1
1
|
# @mastra/libsql
|
|
2
2
|
|
|
3
|
-
## 0.0.0-
|
|
3
|
+
## 0.0.0-vector-query-sources-20250516172905
|
|
4
4
|
|
|
5
5
|
### Patch Changes
|
|
6
6
|
|
|
7
|
+
- eabdcd9: [MASTRA-3451] SQL Injection Protection
|
|
8
|
+
- d0ee3c6: Change all public functions and constructors in vector stores to use named args and prepare to phase out positional args
|
|
9
|
+
- Updated dependencies [f53a6ac]
|
|
10
|
+
- Updated dependencies [eabdcd9]
|
|
11
|
+
- Updated dependencies [d0ee3c6]
|
|
12
|
+
- Updated dependencies [23f258c]
|
|
13
|
+
- Updated dependencies [2672a05]
|
|
14
|
+
- @mastra/core@0.0.0-vector-query-sources-20250516172905
|
|
15
|
+
|
|
16
|
+
## 0.0.4
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- c3bd795: [MASTRA-3358] Deprecate updateIndexById and deleteIndexById
|
|
21
|
+
- Updated dependencies [396be50]
|
|
22
|
+
- Updated dependencies [ab80e7e]
|
|
23
|
+
- Updated dependencies [c3bd795]
|
|
24
|
+
- Updated dependencies [da082f8]
|
|
25
|
+
- Updated dependencies [a5810ce]
|
|
26
|
+
- Updated dependencies [3e9c131]
|
|
27
|
+
- Updated dependencies [3171b5b]
|
|
28
|
+
- Updated dependencies [973e5ac]
|
|
29
|
+
- Updated dependencies [daf942f]
|
|
30
|
+
- Updated dependencies [0b8b868]
|
|
31
|
+
- Updated dependencies [9e1eff5]
|
|
32
|
+
- Updated dependencies [6fa1ad1]
|
|
33
|
+
- Updated dependencies [c28d7a0]
|
|
34
|
+
- Updated dependencies [edf1e88]
|
|
35
|
+
- @mastra/core@0.9.4
|
|
36
|
+
|
|
37
|
+
## 0.0.4-alpha.4
|
|
38
|
+
|
|
39
|
+
### Patch Changes
|
|
40
|
+
|
|
41
|
+
- Updated dependencies [3e9c131]
|
|
42
|
+
- @mastra/core@0.9.4-alpha.4
|
|
43
|
+
|
|
44
|
+
## 0.0.4-alpha.3
|
|
45
|
+
|
|
46
|
+
### Patch Changes
|
|
47
|
+
|
|
48
|
+
- c3bd795: [MASTRA-3358] Deprecate updateIndexById and deleteIndexById
|
|
49
|
+
- Updated dependencies [396be50]
|
|
50
|
+
- Updated dependencies [c3bd795]
|
|
51
|
+
- Updated dependencies [da082f8]
|
|
52
|
+
- Updated dependencies [a5810ce]
|
|
53
|
+
- @mastra/core@0.9.4-alpha.3
|
|
54
|
+
|
|
55
|
+
## 0.0.4-alpha.2
|
|
56
|
+
|
|
57
|
+
### Patch Changes
|
|
58
|
+
|
|
59
|
+
- Updated dependencies [3171b5b]
|
|
60
|
+
- Updated dependencies [973e5ac]
|
|
61
|
+
- Updated dependencies [9e1eff5]
|
|
62
|
+
- @mastra/core@0.9.4-alpha.2
|
|
63
|
+
|
|
64
|
+
## 0.0.4-alpha.1
|
|
65
|
+
|
|
66
|
+
### Patch Changes
|
|
67
|
+
|
|
68
|
+
- Updated dependencies [ab80e7e]
|
|
69
|
+
- Updated dependencies [6fa1ad1]
|
|
70
|
+
- Updated dependencies [c28d7a0]
|
|
71
|
+
- Updated dependencies [edf1e88]
|
|
72
|
+
- @mastra/core@0.9.4-alpha.1
|
|
73
|
+
|
|
74
|
+
## 0.0.4-alpha.0
|
|
75
|
+
|
|
76
|
+
### Patch Changes
|
|
77
|
+
|
|
78
|
+
- Updated dependencies [daf942f]
|
|
79
|
+
- Updated dependencies [0b8b868]
|
|
80
|
+
- @mastra/core@0.9.4-alpha.0
|
|
81
|
+
|
|
82
|
+
## 0.0.3
|
|
83
|
+
|
|
84
|
+
### Patch Changes
|
|
85
|
+
|
|
86
|
+
- Updated dependencies [e450778]
|
|
87
|
+
- Updated dependencies [8902157]
|
|
88
|
+
- Updated dependencies [ca0dc88]
|
|
89
|
+
- Updated dependencies [526c570]
|
|
90
|
+
- Updated dependencies [d7a6a33]
|
|
91
|
+
- Updated dependencies [9cd1a46]
|
|
92
|
+
- Updated dependencies [b5d2de0]
|
|
93
|
+
- Updated dependencies [644f8ad]
|
|
94
|
+
- Updated dependencies [70dbf51]
|
|
95
|
+
- @mastra/core@0.9.3
|
|
96
|
+
|
|
97
|
+
## 0.0.3-alpha.1
|
|
98
|
+
|
|
99
|
+
### Patch Changes
|
|
100
|
+
|
|
101
|
+
- Updated dependencies [e450778]
|
|
102
|
+
- Updated dependencies [8902157]
|
|
103
|
+
- Updated dependencies [ca0dc88]
|
|
104
|
+
- Updated dependencies [9cd1a46]
|
|
105
|
+
- Updated dependencies [70dbf51]
|
|
106
|
+
- @mastra/core@0.9.3-alpha.1
|
|
107
|
+
|
|
108
|
+
## 0.0.3-alpha.0
|
|
109
|
+
|
|
110
|
+
### Patch Changes
|
|
111
|
+
|
|
112
|
+
- Updated dependencies [526c570]
|
|
113
|
+
- Updated dependencies [b5d2de0]
|
|
114
|
+
- Updated dependencies [644f8ad]
|
|
115
|
+
- @mastra/core@0.9.3-alpha.0
|
|
116
|
+
|
|
117
|
+
## 0.0.2
|
|
118
|
+
|
|
119
|
+
### Patch Changes
|
|
120
|
+
|
|
121
|
+
- 4155f47: Add parameters to filter workflow runs
|
|
122
|
+
Add fromDate and toDate to telemetry parameters
|
|
123
|
+
- Updated dependencies [6052aa6]
|
|
124
|
+
- Updated dependencies [967b41c]
|
|
125
|
+
- Updated dependencies [3d2fb5c]
|
|
7
126
|
- Updated dependencies [26738f4]
|
|
127
|
+
- Updated dependencies [4155f47]
|
|
128
|
+
- Updated dependencies [7eeb2bc]
|
|
8
129
|
- Updated dependencies [b804723]
|
|
130
|
+
- Updated dependencies [8607972]
|
|
131
|
+
- Updated dependencies [ccef9f9]
|
|
9
132
|
- Updated dependencies [0097d50]
|
|
10
|
-
|
|
133
|
+
- Updated dependencies [7eeb2bc]
|
|
134
|
+
- Updated dependencies [17826a9]
|
|
135
|
+
- Updated dependencies [7d8b7c7]
|
|
136
|
+
- Updated dependencies [fba031f]
|
|
137
|
+
- Updated dependencies [3a5f1e1]
|
|
138
|
+
- Updated dependencies [51e6923]
|
|
139
|
+
- Updated dependencies [8398d89]
|
|
140
|
+
- @mastra/core@0.9.2
|
|
141
|
+
|
|
142
|
+
## 0.0.2-alpha.6
|
|
143
|
+
|
|
144
|
+
### Patch Changes
|
|
145
|
+
|
|
146
|
+
- Updated dependencies [6052aa6]
|
|
147
|
+
- Updated dependencies [7d8b7c7]
|
|
148
|
+
- Updated dependencies [3a5f1e1]
|
|
149
|
+
- Updated dependencies [8398d89]
|
|
150
|
+
- @mastra/core@0.9.2-alpha.6
|
|
151
|
+
|
|
152
|
+
## 0.0.2-alpha.5
|
|
153
|
+
|
|
154
|
+
### Patch Changes
|
|
155
|
+
|
|
156
|
+
- Updated dependencies [3d2fb5c]
|
|
157
|
+
- Updated dependencies [7eeb2bc]
|
|
158
|
+
- Updated dependencies [8607972]
|
|
159
|
+
- Updated dependencies [7eeb2bc]
|
|
160
|
+
- Updated dependencies [fba031f]
|
|
161
|
+
- @mastra/core@0.9.2-alpha.5
|
|
162
|
+
|
|
163
|
+
## 0.0.2-alpha.4
|
|
164
|
+
|
|
165
|
+
### Patch Changes
|
|
166
|
+
|
|
167
|
+
- Updated dependencies [ccef9f9]
|
|
168
|
+
- Updated dependencies [51e6923]
|
|
169
|
+
- @mastra/core@0.9.2-alpha.4
|
|
170
|
+
|
|
171
|
+
## 0.0.2-alpha.3
|
|
172
|
+
|
|
173
|
+
### Patch Changes
|
|
174
|
+
|
|
175
|
+
- 4155f47: Add parameters to filter workflow runs
|
|
176
|
+
Add fromDate and toDate to telemetry parameters
|
|
177
|
+
- Updated dependencies [967b41c]
|
|
178
|
+
- Updated dependencies [4155f47]
|
|
179
|
+
- Updated dependencies [17826a9]
|
|
180
|
+
- @mastra/core@0.9.2-alpha.3
|
|
11
181
|
|
|
12
182
|
## 0.0.2-alpha.2
|
|
13
183
|
|
|
@@ -1,26 +1,24 @@
|
|
|
1
|
-
import type { ArrayOperator } from '@mastra/core/vector/filter';
|
|
2
1
|
import { BaseFilterTranslator } from '@mastra/core/vector/filter';
|
|
3
|
-
import type { BasicOperator } from '@mastra/core/vector/filter';
|
|
4
2
|
import type { CreateIndexParams } from '@mastra/core/vector';
|
|
5
|
-
import type {
|
|
3
|
+
import type { DeleteIndexParams } from '@mastra/core/vector';
|
|
4
|
+
import type { DeleteVectorParams } from '@mastra/core/vector';
|
|
5
|
+
import type { DescribeIndexParams } from '@mastra/core/vector';
|
|
6
6
|
import type { EvalRow } from '@mastra/core/storage';
|
|
7
7
|
import type { IndexStats } from '@mastra/core/vector';
|
|
8
8
|
import type { InValue } from '@libsql/client';
|
|
9
|
-
import type { LogicalOperator } from '@mastra/core/vector/filter';
|
|
10
9
|
import { MastraStorage } from '@mastra/core/storage';
|
|
11
10
|
import { MastraVector } from '@mastra/core/vector';
|
|
12
11
|
import type { MessageType } from '@mastra/core/memory';
|
|
13
|
-
import type { NumericOperator } from '@mastra/core/vector/filter';
|
|
14
12
|
import type { OperatorSupport } from '@mastra/core/vector/filter';
|
|
15
13
|
import type { ParamsToArgs } from '@mastra/core/vector';
|
|
16
14
|
import type { QueryResult } from '@mastra/core/vector';
|
|
17
15
|
import type { QueryVectorArgs } from '@mastra/core/vector';
|
|
18
16
|
import type { QueryVectorParams } from '@mastra/core/vector';
|
|
19
|
-
import type { RegexOperator } from '@mastra/core/vector/filter';
|
|
20
17
|
import type { StorageColumn } from '@mastra/core/storage';
|
|
21
18
|
import type { StorageGetMessagesArg } from '@mastra/core/storage';
|
|
22
19
|
import type { StorageThreadType } from '@mastra/core/memory';
|
|
23
20
|
import type { TABLE_NAMES } from '@mastra/core/storage';
|
|
21
|
+
import type { UpdateVectorParams } from '@mastra/core/vector';
|
|
24
22
|
import type { UpsertVectorParams } from '@mastra/core/vector';
|
|
25
23
|
import type { VectorFilter } from '@mastra/core/vector/filter';
|
|
26
24
|
import type { WorkflowRun } from '@mastra/core/storage';
|
|
@@ -28,21 +26,11 @@ import type { WorkflowRuns } from '@mastra/core/storage';
|
|
|
28
26
|
|
|
29
27
|
export declare function buildFilterQuery(filter: VectorFilter): FilterResult;
|
|
30
28
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
declare type FilterOperator = {
|
|
34
|
-
sql: string;
|
|
35
|
-
needsValue: boolean;
|
|
36
|
-
transformValue?: (value: any) => any;
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
export declare interface FilterResult {
|
|
29
|
+
declare interface FilterResult {
|
|
40
30
|
sql: string;
|
|
41
31
|
values: InValue[];
|
|
42
32
|
}
|
|
43
33
|
|
|
44
|
-
export declare const handleKey: (key: string) => string;
|
|
45
|
-
|
|
46
34
|
/**
|
|
47
35
|
* Vector store specific prompt that details supported operators and examples.
|
|
48
36
|
* This prompt helps users construct valid filters for LibSQL Vector.
|
|
@@ -128,13 +116,15 @@ declare class LibSQLStore extends MastraStorage {
|
|
|
128
116
|
}): Promise<MessageType[]>;
|
|
129
117
|
private transformEvalRow;
|
|
130
118
|
getEvalsByAgentName(agentName: string, type?: 'test' | 'live'): Promise<EvalRow[]>;
|
|
131
|
-
getTraces({ name, scope, page, perPage, attributes, filters, }?: {
|
|
119
|
+
getTraces({ name, scope, page, perPage, attributes, filters, fromDate, toDate, }?: {
|
|
132
120
|
name?: string;
|
|
133
121
|
scope?: string;
|
|
134
122
|
page: number;
|
|
135
123
|
perPage: number;
|
|
136
124
|
attributes?: Record<string, string>;
|
|
137
125
|
filters?: Record<string, any>;
|
|
126
|
+
fromDate?: Date;
|
|
127
|
+
toDate?: Date;
|
|
138
128
|
}): Promise<any[]>;
|
|
139
129
|
getWorkflowRuns({ workflowName, fromDate, toDate, limit, offset, resourceId, }?: {
|
|
140
130
|
workflowName?: string;
|
|
@@ -168,14 +158,22 @@ declare class LibSQLVector extends MastraVector {
|
|
|
168
158
|
query(...args: ParamsToArgs<LibSQLQueryParams> | LibSQLQueryArgs): Promise<QueryResult[]>;
|
|
169
159
|
upsert(...args: ParamsToArgs<UpsertVectorParams>): Promise<string[]>;
|
|
170
160
|
createIndex(...args: ParamsToArgs<CreateIndexParams>): Promise<void>;
|
|
171
|
-
deleteIndex(
|
|
161
|
+
deleteIndex(...args: ParamsToArgs<DeleteIndexParams>): Promise<void>;
|
|
172
162
|
listIndexes(): Promise<string[]>;
|
|
173
|
-
describeIndex(indexName: string): Promise<IndexStats>;
|
|
174
163
|
/**
|
|
175
|
-
*
|
|
164
|
+
* Retrieves statistics about a vector index.
|
|
176
165
|
*
|
|
177
|
-
* @param
|
|
178
|
-
* @param
|
|
166
|
+
* @param params - The parameters for describing an index
|
|
167
|
+
* @param params.indexName - The name of the index to describe
|
|
168
|
+
* @returns A promise that resolves to the index statistics including dimension, count and metric
|
|
169
|
+
*/
|
|
170
|
+
describeIndex(...args: ParamsToArgs<DescribeIndexParams>): Promise<IndexStats>;
|
|
171
|
+
/**
|
|
172
|
+
* @deprecated Use {@link updateVector} instead. This method will be removed on May 20th, 2025.
|
|
173
|
+
*
|
|
174
|
+
* Updates a vector by its ID with the provided vector and/or metadata.
|
|
175
|
+
* @param indexName - The name of the index containing the vector.
|
|
176
|
+
* @param id - The ID of the vector to update.
|
|
179
177
|
* @param update - An object containing the vector and/or metadata to update.
|
|
180
178
|
* @param update.vector - An optional array of numbers representing the new vector.
|
|
181
179
|
* @param update.metadata - An optional record containing the new metadata.
|
|
@@ -186,14 +184,39 @@ declare class LibSQLVector extends MastraVector {
|
|
|
186
184
|
vector?: number[];
|
|
187
185
|
metadata?: Record<string, any>;
|
|
188
186
|
}): Promise<void>;
|
|
187
|
+
/**
|
|
188
|
+
* Updates a vector by its ID with the provided vector and/or metadata.
|
|
189
|
+
*
|
|
190
|
+
* @param indexName - The name of the index containing the vector.
|
|
191
|
+
* @param id - The ID of the vector to update.
|
|
192
|
+
* @param update - An object containing the vector and/or metadata to update.
|
|
193
|
+
* @param update.vector - An optional array of numbers representing the new vector.
|
|
194
|
+
* @param update.metadata - An optional record containing the new metadata.
|
|
195
|
+
* @returns A promise that resolves when the update is complete.
|
|
196
|
+
* @throws Will throw an error if no updates are provided or if the update operation fails.
|
|
197
|
+
*/
|
|
198
|
+
updateVector(...args: ParamsToArgs<UpdateVectorParams>): Promise<void>;
|
|
199
|
+
/**
|
|
200
|
+
* @deprecated Use {@link deleteVector} instead. This method will be removed on May 20th, 2025.
|
|
201
|
+
*
|
|
202
|
+
* Deletes a vector by its ID.
|
|
203
|
+
* @param indexName - The name of the index containing the vector.
|
|
204
|
+
* @param id - The ID of the vector to delete.
|
|
205
|
+
* @returns A promise that resolves when the deletion is complete.
|
|
206
|
+
* @throws Will throw an error if the deletion operation fails.
|
|
207
|
+
*/
|
|
189
208
|
deleteIndexById(indexName: string, id: string): Promise<void>;
|
|
190
|
-
|
|
209
|
+
/**
|
|
210
|
+
* Deletes a vector by its ID.
|
|
211
|
+
* @param indexName - The name of the index containing the vector.
|
|
212
|
+
* @param id - The ID of the vector to delete.
|
|
213
|
+
* @returns A promise that resolves when the deletion is complete.
|
|
214
|
+
* @throws Will throw an error if the deletion operation fails.
|
|
215
|
+
*/
|
|
216
|
+
deleteVector(...args: ParamsToArgs<DeleteVectorParams>): Promise<void>;
|
|
217
|
+
truncateIndex(...args: ParamsToArgs<DeleteIndexParams>): Promise<void>;
|
|
191
218
|
}
|
|
192
219
|
export { LibSQLVector }
|
|
193
220
|
export { LibSQLVector as LibSQLVector_alias_1 }
|
|
194
221
|
|
|
195
|
-
declare type OperatorFn = (key: string, value?: any) => FilterOperator;
|
|
196
|
-
|
|
197
|
-
export declare type OperatorType = BasicOperator | NumericOperator | ArrayOperator | ElementOperator | LogicalOperator | '$contains' | Exclude<RegexOperator, '$options'>;
|
|
198
|
-
|
|
199
222
|
export { }
|
|
@@ -1,26 +1,24 @@
|
|
|
1
|
-
import type { ArrayOperator } from '@mastra/core/vector/filter';
|
|
2
1
|
import { BaseFilterTranslator } from '@mastra/core/vector/filter';
|
|
3
|
-
import type { BasicOperator } from '@mastra/core/vector/filter';
|
|
4
2
|
import type { CreateIndexParams } from '@mastra/core/vector';
|
|
5
|
-
import type {
|
|
3
|
+
import type { DeleteIndexParams } from '@mastra/core/vector';
|
|
4
|
+
import type { DeleteVectorParams } from '@mastra/core/vector';
|
|
5
|
+
import type { DescribeIndexParams } from '@mastra/core/vector';
|
|
6
6
|
import type { EvalRow } from '@mastra/core/storage';
|
|
7
7
|
import type { IndexStats } from '@mastra/core/vector';
|
|
8
8
|
import type { InValue } from '@libsql/client';
|
|
9
|
-
import type { LogicalOperator } from '@mastra/core/vector/filter';
|
|
10
9
|
import { MastraStorage } from '@mastra/core/storage';
|
|
11
10
|
import { MastraVector } from '@mastra/core/vector';
|
|
12
11
|
import type { MessageType } from '@mastra/core/memory';
|
|
13
|
-
import type { NumericOperator } from '@mastra/core/vector/filter';
|
|
14
12
|
import type { OperatorSupport } from '@mastra/core/vector/filter';
|
|
15
13
|
import type { ParamsToArgs } from '@mastra/core/vector';
|
|
16
14
|
import type { QueryResult } from '@mastra/core/vector';
|
|
17
15
|
import type { QueryVectorArgs } from '@mastra/core/vector';
|
|
18
16
|
import type { QueryVectorParams } from '@mastra/core/vector';
|
|
19
|
-
import type { RegexOperator } from '@mastra/core/vector/filter';
|
|
20
17
|
import type { StorageColumn } from '@mastra/core/storage';
|
|
21
18
|
import type { StorageGetMessagesArg } from '@mastra/core/storage';
|
|
22
19
|
import type { StorageThreadType } from '@mastra/core/memory';
|
|
23
20
|
import type { TABLE_NAMES } from '@mastra/core/storage';
|
|
21
|
+
import type { UpdateVectorParams } from '@mastra/core/vector';
|
|
24
22
|
import type { UpsertVectorParams } from '@mastra/core/vector';
|
|
25
23
|
import type { VectorFilter } from '@mastra/core/vector/filter';
|
|
26
24
|
import type { WorkflowRun } from '@mastra/core/storage';
|
|
@@ -28,21 +26,11 @@ import type { WorkflowRuns } from '@mastra/core/storage';
|
|
|
28
26
|
|
|
29
27
|
export declare function buildFilterQuery(filter: VectorFilter): FilterResult;
|
|
30
28
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
declare type FilterOperator = {
|
|
34
|
-
sql: string;
|
|
35
|
-
needsValue: boolean;
|
|
36
|
-
transformValue?: (value: any) => any;
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
export declare interface FilterResult {
|
|
29
|
+
declare interface FilterResult {
|
|
40
30
|
sql: string;
|
|
41
31
|
values: InValue[];
|
|
42
32
|
}
|
|
43
33
|
|
|
44
|
-
export declare const handleKey: (key: string) => string;
|
|
45
|
-
|
|
46
34
|
/**
|
|
47
35
|
* Vector store specific prompt that details supported operators and examples.
|
|
48
36
|
* This prompt helps users construct valid filters for LibSQL Vector.
|
|
@@ -128,13 +116,15 @@ declare class LibSQLStore extends MastraStorage {
|
|
|
128
116
|
}): Promise<MessageType[]>;
|
|
129
117
|
private transformEvalRow;
|
|
130
118
|
getEvalsByAgentName(agentName: string, type?: 'test' | 'live'): Promise<EvalRow[]>;
|
|
131
|
-
getTraces({ name, scope, page, perPage, attributes, filters, }?: {
|
|
119
|
+
getTraces({ name, scope, page, perPage, attributes, filters, fromDate, toDate, }?: {
|
|
132
120
|
name?: string;
|
|
133
121
|
scope?: string;
|
|
134
122
|
page: number;
|
|
135
123
|
perPage: number;
|
|
136
124
|
attributes?: Record<string, string>;
|
|
137
125
|
filters?: Record<string, any>;
|
|
126
|
+
fromDate?: Date;
|
|
127
|
+
toDate?: Date;
|
|
138
128
|
}): Promise<any[]>;
|
|
139
129
|
getWorkflowRuns({ workflowName, fromDate, toDate, limit, offset, resourceId, }?: {
|
|
140
130
|
workflowName?: string;
|
|
@@ -168,14 +158,22 @@ declare class LibSQLVector extends MastraVector {
|
|
|
168
158
|
query(...args: ParamsToArgs<LibSQLQueryParams> | LibSQLQueryArgs): Promise<QueryResult[]>;
|
|
169
159
|
upsert(...args: ParamsToArgs<UpsertVectorParams>): Promise<string[]>;
|
|
170
160
|
createIndex(...args: ParamsToArgs<CreateIndexParams>): Promise<void>;
|
|
171
|
-
deleteIndex(
|
|
161
|
+
deleteIndex(...args: ParamsToArgs<DeleteIndexParams>): Promise<void>;
|
|
172
162
|
listIndexes(): Promise<string[]>;
|
|
173
|
-
describeIndex(indexName: string): Promise<IndexStats>;
|
|
174
163
|
/**
|
|
175
|
-
*
|
|
164
|
+
* Retrieves statistics about a vector index.
|
|
176
165
|
*
|
|
177
|
-
* @param
|
|
178
|
-
* @param
|
|
166
|
+
* @param params - The parameters for describing an index
|
|
167
|
+
* @param params.indexName - The name of the index to describe
|
|
168
|
+
* @returns A promise that resolves to the index statistics including dimension, count and metric
|
|
169
|
+
*/
|
|
170
|
+
describeIndex(...args: ParamsToArgs<DescribeIndexParams>): Promise<IndexStats>;
|
|
171
|
+
/**
|
|
172
|
+
* @deprecated Use {@link updateVector} instead. This method will be removed on May 20th, 2025.
|
|
173
|
+
*
|
|
174
|
+
* Updates a vector by its ID with the provided vector and/or metadata.
|
|
175
|
+
* @param indexName - The name of the index containing the vector.
|
|
176
|
+
* @param id - The ID of the vector to update.
|
|
179
177
|
* @param update - An object containing the vector and/or metadata to update.
|
|
180
178
|
* @param update.vector - An optional array of numbers representing the new vector.
|
|
181
179
|
* @param update.metadata - An optional record containing the new metadata.
|
|
@@ -186,14 +184,39 @@ declare class LibSQLVector extends MastraVector {
|
|
|
186
184
|
vector?: number[];
|
|
187
185
|
metadata?: Record<string, any>;
|
|
188
186
|
}): Promise<void>;
|
|
187
|
+
/**
|
|
188
|
+
* Updates a vector by its ID with the provided vector and/or metadata.
|
|
189
|
+
*
|
|
190
|
+
* @param indexName - The name of the index containing the vector.
|
|
191
|
+
* @param id - The ID of the vector to update.
|
|
192
|
+
* @param update - An object containing the vector and/or metadata to update.
|
|
193
|
+
* @param update.vector - An optional array of numbers representing the new vector.
|
|
194
|
+
* @param update.metadata - An optional record containing the new metadata.
|
|
195
|
+
* @returns A promise that resolves when the update is complete.
|
|
196
|
+
* @throws Will throw an error if no updates are provided or if the update operation fails.
|
|
197
|
+
*/
|
|
198
|
+
updateVector(...args: ParamsToArgs<UpdateVectorParams>): Promise<void>;
|
|
199
|
+
/**
|
|
200
|
+
* @deprecated Use {@link deleteVector} instead. This method will be removed on May 20th, 2025.
|
|
201
|
+
*
|
|
202
|
+
* Deletes a vector by its ID.
|
|
203
|
+
* @param indexName - The name of the index containing the vector.
|
|
204
|
+
* @param id - The ID of the vector to delete.
|
|
205
|
+
* @returns A promise that resolves when the deletion is complete.
|
|
206
|
+
* @throws Will throw an error if the deletion operation fails.
|
|
207
|
+
*/
|
|
189
208
|
deleteIndexById(indexName: string, id: string): Promise<void>;
|
|
190
|
-
|
|
209
|
+
/**
|
|
210
|
+
* Deletes a vector by its ID.
|
|
211
|
+
* @param indexName - The name of the index containing the vector.
|
|
212
|
+
* @param id - The ID of the vector to delete.
|
|
213
|
+
* @returns A promise that resolves when the deletion is complete.
|
|
214
|
+
* @throws Will throw an error if the deletion operation fails.
|
|
215
|
+
*/
|
|
216
|
+
deleteVector(...args: ParamsToArgs<DeleteVectorParams>): Promise<void>;
|
|
217
|
+
truncateIndex(...args: ParamsToArgs<DeleteIndexParams>): Promise<void>;
|
|
191
218
|
}
|
|
192
219
|
export { LibSQLVector }
|
|
193
220
|
export { LibSQLVector as LibSQLVector_alias_1 }
|
|
194
221
|
|
|
195
|
-
declare type OperatorFn = (key: string, value?: any) => FilterOperator;
|
|
196
|
-
|
|
197
|
-
export declare type OperatorType = BasicOperator | NumericOperator | ArrayOperator | ElementOperator | LogicalOperator | '$contains' | Exclude<RegexOperator, '$options'>;
|
|
198
|
-
|
|
199
222
|
export { }
|