@convex-dev/rag 0.5.3 → 0.6.0
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/README.md +89 -82
- package/dist/client/index.d.ts +39 -26
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +26 -8
- package/dist/client/index.js.map +1 -1
- package/dist/component/_generated/api.d.ts +100 -481
- package/dist/component/_generated/api.d.ts.map +1 -1
- package/dist/component/_generated/api.js +10 -1
- package/dist/component/_generated/api.js.map +1 -1
- package/dist/component/_generated/component.d.ts +380 -0
- package/dist/component/_generated/component.d.ts.map +1 -0
- package/dist/component/_generated/component.js +11 -0
- package/dist/component/_generated/component.js.map +1 -0
- package/dist/component/_generated/dataModel.d.ts +4 -18
- package/dist/component/_generated/dataModel.d.ts.map +1 -0
- package/dist/component/_generated/dataModel.js +11 -0
- package/dist/component/_generated/dataModel.js.map +1 -0
- package/dist/component/_generated/server.d.ts +10 -38
- package/dist/component/_generated/server.d.ts.map +1 -1
- package/dist/component/_generated/server.js +9 -5
- package/dist/component/_generated/server.js.map +1 -1
- package/dist/component/chunks.d.ts +5 -5
- package/dist/component/chunks.d.ts.map +1 -1
- package/dist/component/chunks.js +11 -44
- package/dist/component/chunks.js.map +1 -1
- package/dist/component/embeddings/tables.d.ts +4 -5
- package/dist/component/embeddings/tables.d.ts.map +1 -1
- package/dist/component/embeddings/tables.js.map +1 -1
- package/dist/component/entries.d.ts +6 -6
- package/dist/component/namespaces.d.ts +8 -8
- package/dist/component/namespaces.d.ts.map +1 -1
- package/dist/component/namespaces.js +2 -2
- package/dist/component/namespaces.js.map +1 -1
- package/dist/component/schema.d.ts +185 -224
- package/dist/component/schema.d.ts.map +1 -1
- package/dist/component/search.d.ts +4 -3
- package/dist/component/search.d.ts.map +1 -1
- package/dist/component/search.js +1 -1
- package/dist/component/search.js.map +1 -1
- package/dist/shared.d.ts +9 -4
- package/dist/shared.d.ts.map +1 -1
- package/dist/shared.js +1 -4
- package/dist/shared.js.map +1 -1
- package/package.json +71 -42
- package/src/client/defaultChunker.test.ts +1 -1
- package/src/client/defaultChunker.ts +7 -7
- package/src/client/fileUtils.ts +3 -3
- package/src/client/hybridRank.ts +1 -1
- package/src/client/index.test.ts +18 -18
- package/src/client/index.ts +135 -90
- package/src/client/setup.test.ts +2 -2
- package/src/component/_generated/api.ts +152 -0
- package/src/component/_generated/component.ts +442 -0
- package/src/component/_generated/{server.d.ts → server.ts} +33 -21
- package/src/component/chunks.test.ts +14 -14
- package/src/component/chunks.ts +49 -82
- package/src/component/embeddings/importance.test.ts +4 -4
- package/src/component/embeddings/importance.ts +1 -1
- package/src/component/embeddings/index.test.ts +3 -4
- package/src/component/embeddings/index.ts +6 -6
- package/src/component/embeddings/tables.ts +9 -8
- package/src/component/entries.test.ts +10 -10
- package/src/component/entries.ts +29 -29
- package/src/component/filters.ts +8 -8
- package/src/component/namespaces.ts +31 -34
- package/src/component/schema.ts +2 -2
- package/src/component/search.test.ts +5 -5
- package/src/component/search.ts +8 -9
- package/src/component/setup.test.ts +2 -8
- package/src/shared.ts +47 -45
- package/src/test.ts +20 -0
- package/dist/client/types.d.ts +0 -29
- package/dist/client/types.d.ts.map +0 -1
- package/dist/client/types.js +0 -2
- package/dist/client/types.js.map +0 -1
- package/dist/package.json +0 -3
- package/src/client/types.ts +0 -69
- package/src/component/_generated/api.d.ts +0 -507
- package/src/component/_generated/api.js +0 -23
- package/src/component/_generated/server.js +0 -90
- package/src/vitest.config.ts +0 -7
- /package/src/component/_generated/{dataModel.d.ts → dataModel.ts} +0 -0
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
/**
|
|
3
|
+
* Generated `api` utility.
|
|
4
|
+
*
|
|
5
|
+
* THIS CODE IS AUTOMATICALLY GENERATED.
|
|
6
|
+
*
|
|
7
|
+
* To regenerate, run `npx convex dev`.
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import type * as chunks from "../chunks.js";
|
|
12
|
+
import type * as embeddings_importance from "../embeddings/importance.js";
|
|
13
|
+
import type * as embeddings_index from "../embeddings/index.js";
|
|
14
|
+
import type * as embeddings_tables from "../embeddings/tables.js";
|
|
15
|
+
import type * as entries from "../entries.js";
|
|
16
|
+
import type * as filters from "../filters.js";
|
|
17
|
+
import type * as namespaces from "../namespaces.js";
|
|
18
|
+
import type * as search from "../search.js";
|
|
19
|
+
|
|
20
|
+
import type {
|
|
21
|
+
ApiFromModules,
|
|
22
|
+
FilterApi,
|
|
23
|
+
FunctionReference,
|
|
24
|
+
} from "convex/server";
|
|
25
|
+
import { anyApi, componentsGeneric } from "convex/server";
|
|
26
|
+
|
|
27
|
+
const fullApi: ApiFromModules<{
|
|
28
|
+
chunks: typeof chunks;
|
|
29
|
+
"embeddings/importance": typeof embeddings_importance;
|
|
30
|
+
"embeddings/index": typeof embeddings_index;
|
|
31
|
+
"embeddings/tables": typeof embeddings_tables;
|
|
32
|
+
entries: typeof entries;
|
|
33
|
+
filters: typeof filters;
|
|
34
|
+
namespaces: typeof namespaces;
|
|
35
|
+
search: typeof search;
|
|
36
|
+
}> = anyApi as any;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* A utility for referencing Convex functions in your app's public API.
|
|
40
|
+
*
|
|
41
|
+
* Usage:
|
|
42
|
+
* ```js
|
|
43
|
+
* const myFunctionReference = api.myModule.myFunction;
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
export const api: FilterApi<
|
|
47
|
+
typeof fullApi,
|
|
48
|
+
FunctionReference<any, "public">
|
|
49
|
+
> = anyApi as any;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* A utility for referencing Convex functions in your app's internal API.
|
|
53
|
+
*
|
|
54
|
+
* Usage:
|
|
55
|
+
* ```js
|
|
56
|
+
* const myFunctionReference = internal.myModule.myFunction;
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
export const internal: FilterApi<
|
|
60
|
+
typeof fullApi,
|
|
61
|
+
FunctionReference<any, "internal">
|
|
62
|
+
> = anyApi as any;
|
|
63
|
+
|
|
64
|
+
export const components = componentsGeneric() as unknown as {
|
|
65
|
+
workpool: {
|
|
66
|
+
lib: {
|
|
67
|
+
cancel: FunctionReference<
|
|
68
|
+
"mutation",
|
|
69
|
+
"internal",
|
|
70
|
+
{
|
|
71
|
+
id: string;
|
|
72
|
+
logLevel: "DEBUG" | "TRACE" | "INFO" | "REPORT" | "WARN" | "ERROR";
|
|
73
|
+
},
|
|
74
|
+
any
|
|
75
|
+
>;
|
|
76
|
+
cancelAll: FunctionReference<
|
|
77
|
+
"mutation",
|
|
78
|
+
"internal",
|
|
79
|
+
{
|
|
80
|
+
before?: number;
|
|
81
|
+
limit?: number;
|
|
82
|
+
logLevel: "DEBUG" | "TRACE" | "INFO" | "REPORT" | "WARN" | "ERROR";
|
|
83
|
+
},
|
|
84
|
+
any
|
|
85
|
+
>;
|
|
86
|
+
enqueue: FunctionReference<
|
|
87
|
+
"mutation",
|
|
88
|
+
"internal",
|
|
89
|
+
{
|
|
90
|
+
config: {
|
|
91
|
+
logLevel: "DEBUG" | "TRACE" | "INFO" | "REPORT" | "WARN" | "ERROR";
|
|
92
|
+
maxParallelism: number;
|
|
93
|
+
};
|
|
94
|
+
fnArgs: any;
|
|
95
|
+
fnHandle: string;
|
|
96
|
+
fnName: string;
|
|
97
|
+
fnType: "action" | "mutation" | "query";
|
|
98
|
+
onComplete?: { context?: any; fnHandle: string };
|
|
99
|
+
retryBehavior?: {
|
|
100
|
+
base: number;
|
|
101
|
+
initialBackoffMs: number;
|
|
102
|
+
maxAttempts: number;
|
|
103
|
+
};
|
|
104
|
+
runAt: number;
|
|
105
|
+
},
|
|
106
|
+
string
|
|
107
|
+
>;
|
|
108
|
+
enqueueBatch: FunctionReference<
|
|
109
|
+
"mutation",
|
|
110
|
+
"internal",
|
|
111
|
+
{
|
|
112
|
+
config: {
|
|
113
|
+
logLevel: "DEBUG" | "TRACE" | "INFO" | "REPORT" | "WARN" | "ERROR";
|
|
114
|
+
maxParallelism: number;
|
|
115
|
+
};
|
|
116
|
+
items: Array<{
|
|
117
|
+
fnArgs: any;
|
|
118
|
+
fnHandle: string;
|
|
119
|
+
fnName: string;
|
|
120
|
+
fnType: "action" | "mutation" | "query";
|
|
121
|
+
onComplete?: { context?: any; fnHandle: string };
|
|
122
|
+
retryBehavior?: {
|
|
123
|
+
base: number;
|
|
124
|
+
initialBackoffMs: number;
|
|
125
|
+
maxAttempts: number;
|
|
126
|
+
};
|
|
127
|
+
runAt: number;
|
|
128
|
+
}>;
|
|
129
|
+
},
|
|
130
|
+
Array<string>
|
|
131
|
+
>;
|
|
132
|
+
status: FunctionReference<
|
|
133
|
+
"query",
|
|
134
|
+
"internal",
|
|
135
|
+
{ id: string },
|
|
136
|
+
| { previousAttempts: number; state: "pending" }
|
|
137
|
+
| { previousAttempts: number; state: "running" }
|
|
138
|
+
| { state: "finished" }
|
|
139
|
+
>;
|
|
140
|
+
statusBatch: FunctionReference<
|
|
141
|
+
"query",
|
|
142
|
+
"internal",
|
|
143
|
+
{ ids: Array<string> },
|
|
144
|
+
Array<
|
|
145
|
+
| { previousAttempts: number; state: "pending" }
|
|
146
|
+
| { previousAttempts: number; state: "running" }
|
|
147
|
+
| { state: "finished" }
|
|
148
|
+
>
|
|
149
|
+
>;
|
|
150
|
+
};
|
|
151
|
+
};
|
|
152
|
+
};
|
|
@@ -0,0 +1,442 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
/**
|
|
3
|
+
* Generated `ComponentApi` utility.
|
|
4
|
+
*
|
|
5
|
+
* THIS CODE IS AUTOMATICALLY GENERATED.
|
|
6
|
+
*
|
|
7
|
+
* To regenerate, run `npx convex dev`.
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import type { FunctionReference } from "convex/server";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* A utility for referencing a Convex component's exposed API.
|
|
15
|
+
*
|
|
16
|
+
* Useful when expecting a parameter like `components.myComponent`.
|
|
17
|
+
* Usage:
|
|
18
|
+
* ```ts
|
|
19
|
+
* async function myFunction(ctx: QueryCtx, component: ComponentApi) {
|
|
20
|
+
* return ctx.runQuery(component.someFile.someQuery, { ...args });
|
|
21
|
+
* }
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
export type ComponentApi<Name extends string | undefined = string | undefined> =
|
|
25
|
+
{
|
|
26
|
+
chunks: {
|
|
27
|
+
insert: FunctionReference<
|
|
28
|
+
"mutation",
|
|
29
|
+
"internal",
|
|
30
|
+
{
|
|
31
|
+
chunks: Array<{
|
|
32
|
+
content: { metadata?: Record<string, any>; text: string };
|
|
33
|
+
embedding: Array<number>;
|
|
34
|
+
searchableText?: string;
|
|
35
|
+
}>;
|
|
36
|
+
entryId: string;
|
|
37
|
+
startOrder: number;
|
|
38
|
+
},
|
|
39
|
+
{ status: "pending" | "ready" | "replaced" },
|
|
40
|
+
Name
|
|
41
|
+
>;
|
|
42
|
+
list: FunctionReference<
|
|
43
|
+
"query",
|
|
44
|
+
"internal",
|
|
45
|
+
{
|
|
46
|
+
entryId: string;
|
|
47
|
+
order: "desc" | "asc";
|
|
48
|
+
paginationOpts: {
|
|
49
|
+
cursor: string | null;
|
|
50
|
+
endCursor?: string | null;
|
|
51
|
+
id?: number;
|
|
52
|
+
maximumBytesRead?: number;
|
|
53
|
+
maximumRowsRead?: number;
|
|
54
|
+
numItems: number;
|
|
55
|
+
};
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
continueCursor: string;
|
|
59
|
+
isDone: boolean;
|
|
60
|
+
page: Array<{
|
|
61
|
+
metadata?: Record<string, any>;
|
|
62
|
+
order: number;
|
|
63
|
+
state: "pending" | "ready" | "replaced";
|
|
64
|
+
text: string;
|
|
65
|
+
}>;
|
|
66
|
+
pageStatus?: "SplitRecommended" | "SplitRequired" | null;
|
|
67
|
+
splitCursor?: string | null;
|
|
68
|
+
},
|
|
69
|
+
Name
|
|
70
|
+
>;
|
|
71
|
+
replaceChunksPage: FunctionReference<
|
|
72
|
+
"mutation",
|
|
73
|
+
"internal",
|
|
74
|
+
{ entryId: string; startOrder: number },
|
|
75
|
+
{ nextStartOrder: number; status: "pending" | "ready" | "replaced" },
|
|
76
|
+
Name
|
|
77
|
+
>;
|
|
78
|
+
};
|
|
79
|
+
entries: {
|
|
80
|
+
add: FunctionReference<
|
|
81
|
+
"mutation",
|
|
82
|
+
"internal",
|
|
83
|
+
{
|
|
84
|
+
allChunks?: Array<{
|
|
85
|
+
content: { metadata?: Record<string, any>; text: string };
|
|
86
|
+
embedding: Array<number>;
|
|
87
|
+
searchableText?: string;
|
|
88
|
+
}>;
|
|
89
|
+
entry: {
|
|
90
|
+
contentHash?: string;
|
|
91
|
+
filterValues: Array<{ name: string; value: any }>;
|
|
92
|
+
importance: number;
|
|
93
|
+
key?: string;
|
|
94
|
+
metadata?: Record<string, any>;
|
|
95
|
+
namespaceId: string;
|
|
96
|
+
title?: string;
|
|
97
|
+
};
|
|
98
|
+
onComplete?: string;
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
created: boolean;
|
|
102
|
+
entryId: string;
|
|
103
|
+
status: "pending" | "ready" | "replaced";
|
|
104
|
+
},
|
|
105
|
+
Name
|
|
106
|
+
>;
|
|
107
|
+
addAsync: FunctionReference<
|
|
108
|
+
"mutation",
|
|
109
|
+
"internal",
|
|
110
|
+
{
|
|
111
|
+
chunker: string;
|
|
112
|
+
entry: {
|
|
113
|
+
contentHash?: string;
|
|
114
|
+
filterValues: Array<{ name: string; value: any }>;
|
|
115
|
+
importance: number;
|
|
116
|
+
key?: string;
|
|
117
|
+
metadata?: Record<string, any>;
|
|
118
|
+
namespaceId: string;
|
|
119
|
+
title?: string;
|
|
120
|
+
};
|
|
121
|
+
onComplete?: string;
|
|
122
|
+
},
|
|
123
|
+
{ created: boolean; entryId: string; status: "pending" | "ready" },
|
|
124
|
+
Name
|
|
125
|
+
>;
|
|
126
|
+
deleteAsync: FunctionReference<
|
|
127
|
+
"mutation",
|
|
128
|
+
"internal",
|
|
129
|
+
{ entryId: string; startOrder: number },
|
|
130
|
+
null,
|
|
131
|
+
Name
|
|
132
|
+
>;
|
|
133
|
+
deleteByKeyAsync: FunctionReference<
|
|
134
|
+
"mutation",
|
|
135
|
+
"internal",
|
|
136
|
+
{ beforeVersion?: number; key: string; namespaceId: string },
|
|
137
|
+
null,
|
|
138
|
+
Name
|
|
139
|
+
>;
|
|
140
|
+
deleteByKeySync: FunctionReference<
|
|
141
|
+
"action",
|
|
142
|
+
"internal",
|
|
143
|
+
{ key: string; namespaceId: string },
|
|
144
|
+
null,
|
|
145
|
+
Name
|
|
146
|
+
>;
|
|
147
|
+
deleteSync: FunctionReference<
|
|
148
|
+
"action",
|
|
149
|
+
"internal",
|
|
150
|
+
{ entryId: string },
|
|
151
|
+
null,
|
|
152
|
+
Name
|
|
153
|
+
>;
|
|
154
|
+
findByContentHash: FunctionReference<
|
|
155
|
+
"query",
|
|
156
|
+
"internal",
|
|
157
|
+
{
|
|
158
|
+
contentHash: string;
|
|
159
|
+
dimension: number;
|
|
160
|
+
filterNames: Array<string>;
|
|
161
|
+
key: string;
|
|
162
|
+
modelId: string;
|
|
163
|
+
namespace: string;
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
contentHash?: string;
|
|
167
|
+
entryId: string;
|
|
168
|
+
filterValues: Array<{ name: string; value: any }>;
|
|
169
|
+
importance: number;
|
|
170
|
+
key?: string;
|
|
171
|
+
metadata?: Record<string, any>;
|
|
172
|
+
replacedAt?: number;
|
|
173
|
+
status: "pending" | "ready" | "replaced";
|
|
174
|
+
title?: string;
|
|
175
|
+
} | null,
|
|
176
|
+
Name
|
|
177
|
+
>;
|
|
178
|
+
get: FunctionReference<
|
|
179
|
+
"query",
|
|
180
|
+
"internal",
|
|
181
|
+
{ entryId: string },
|
|
182
|
+
{
|
|
183
|
+
contentHash?: string;
|
|
184
|
+
entryId: string;
|
|
185
|
+
filterValues: Array<{ name: string; value: any }>;
|
|
186
|
+
importance: number;
|
|
187
|
+
key?: string;
|
|
188
|
+
metadata?: Record<string, any>;
|
|
189
|
+
replacedAt?: number;
|
|
190
|
+
status: "pending" | "ready" | "replaced";
|
|
191
|
+
title?: string;
|
|
192
|
+
} | null,
|
|
193
|
+
Name
|
|
194
|
+
>;
|
|
195
|
+
list: FunctionReference<
|
|
196
|
+
"query",
|
|
197
|
+
"internal",
|
|
198
|
+
{
|
|
199
|
+
namespaceId?: string;
|
|
200
|
+
order?: "desc" | "asc";
|
|
201
|
+
paginationOpts: {
|
|
202
|
+
cursor: string | null;
|
|
203
|
+
endCursor?: string | null;
|
|
204
|
+
id?: number;
|
|
205
|
+
maximumBytesRead?: number;
|
|
206
|
+
maximumRowsRead?: number;
|
|
207
|
+
numItems: number;
|
|
208
|
+
};
|
|
209
|
+
status: "pending" | "ready" | "replaced";
|
|
210
|
+
},
|
|
211
|
+
{
|
|
212
|
+
continueCursor: string;
|
|
213
|
+
isDone: boolean;
|
|
214
|
+
page: Array<{
|
|
215
|
+
contentHash?: string;
|
|
216
|
+
entryId: string;
|
|
217
|
+
filterValues: Array<{ name: string; value: any }>;
|
|
218
|
+
importance: number;
|
|
219
|
+
key?: string;
|
|
220
|
+
metadata?: Record<string, any>;
|
|
221
|
+
replacedAt?: number;
|
|
222
|
+
status: "pending" | "ready" | "replaced";
|
|
223
|
+
title?: string;
|
|
224
|
+
}>;
|
|
225
|
+
pageStatus?: "SplitRecommended" | "SplitRequired" | null;
|
|
226
|
+
splitCursor?: string | null;
|
|
227
|
+
},
|
|
228
|
+
Name
|
|
229
|
+
>;
|
|
230
|
+
promoteToReady: FunctionReference<
|
|
231
|
+
"mutation",
|
|
232
|
+
"internal",
|
|
233
|
+
{ entryId: string },
|
|
234
|
+
{
|
|
235
|
+
replacedEntry: {
|
|
236
|
+
contentHash?: string;
|
|
237
|
+
entryId: string;
|
|
238
|
+
filterValues: Array<{ name: string; value: any }>;
|
|
239
|
+
importance: number;
|
|
240
|
+
key?: string;
|
|
241
|
+
metadata?: Record<string, any>;
|
|
242
|
+
replacedAt?: number;
|
|
243
|
+
status: "pending" | "ready" | "replaced";
|
|
244
|
+
title?: string;
|
|
245
|
+
} | null;
|
|
246
|
+
},
|
|
247
|
+
Name
|
|
248
|
+
>;
|
|
249
|
+
};
|
|
250
|
+
namespaces: {
|
|
251
|
+
deleteNamespace: FunctionReference<
|
|
252
|
+
"mutation",
|
|
253
|
+
"internal",
|
|
254
|
+
{ namespaceId: string },
|
|
255
|
+
{
|
|
256
|
+
deletedNamespace: null | {
|
|
257
|
+
createdAt: number;
|
|
258
|
+
dimension: number;
|
|
259
|
+
filterNames: Array<string>;
|
|
260
|
+
modelId: string;
|
|
261
|
+
namespace: string;
|
|
262
|
+
namespaceId: string;
|
|
263
|
+
status: "pending" | "ready" | "replaced";
|
|
264
|
+
version: number;
|
|
265
|
+
};
|
|
266
|
+
},
|
|
267
|
+
Name
|
|
268
|
+
>;
|
|
269
|
+
deleteNamespaceSync: FunctionReference<
|
|
270
|
+
"action",
|
|
271
|
+
"internal",
|
|
272
|
+
{ namespaceId: string },
|
|
273
|
+
null,
|
|
274
|
+
Name
|
|
275
|
+
>;
|
|
276
|
+
get: FunctionReference<
|
|
277
|
+
"query",
|
|
278
|
+
"internal",
|
|
279
|
+
{
|
|
280
|
+
dimension: number;
|
|
281
|
+
filterNames: Array<string>;
|
|
282
|
+
modelId: string;
|
|
283
|
+
namespace: string;
|
|
284
|
+
},
|
|
285
|
+
null | {
|
|
286
|
+
createdAt: number;
|
|
287
|
+
dimension: number;
|
|
288
|
+
filterNames: Array<string>;
|
|
289
|
+
modelId: string;
|
|
290
|
+
namespace: string;
|
|
291
|
+
namespaceId: string;
|
|
292
|
+
status: "pending" | "ready" | "replaced";
|
|
293
|
+
version: number;
|
|
294
|
+
},
|
|
295
|
+
Name
|
|
296
|
+
>;
|
|
297
|
+
getOrCreate: FunctionReference<
|
|
298
|
+
"mutation",
|
|
299
|
+
"internal",
|
|
300
|
+
{
|
|
301
|
+
dimension: number;
|
|
302
|
+
filterNames: Array<string>;
|
|
303
|
+
modelId: string;
|
|
304
|
+
namespace: string;
|
|
305
|
+
onComplete?: string;
|
|
306
|
+
status: "pending" | "ready";
|
|
307
|
+
},
|
|
308
|
+
{ namespaceId: string; status: "pending" | "ready" },
|
|
309
|
+
Name
|
|
310
|
+
>;
|
|
311
|
+
list: FunctionReference<
|
|
312
|
+
"query",
|
|
313
|
+
"internal",
|
|
314
|
+
{
|
|
315
|
+
paginationOpts: {
|
|
316
|
+
cursor: string | null;
|
|
317
|
+
endCursor?: string | null;
|
|
318
|
+
id?: number;
|
|
319
|
+
maximumBytesRead?: number;
|
|
320
|
+
maximumRowsRead?: number;
|
|
321
|
+
numItems: number;
|
|
322
|
+
};
|
|
323
|
+
status: "pending" | "ready" | "replaced";
|
|
324
|
+
},
|
|
325
|
+
{
|
|
326
|
+
continueCursor: string;
|
|
327
|
+
isDone: boolean;
|
|
328
|
+
page: Array<{
|
|
329
|
+
createdAt: number;
|
|
330
|
+
dimension: number;
|
|
331
|
+
filterNames: Array<string>;
|
|
332
|
+
modelId: string;
|
|
333
|
+
namespace: string;
|
|
334
|
+
namespaceId: string;
|
|
335
|
+
status: "pending" | "ready" | "replaced";
|
|
336
|
+
version: number;
|
|
337
|
+
}>;
|
|
338
|
+
pageStatus?: "SplitRecommended" | "SplitRequired" | null;
|
|
339
|
+
splitCursor?: string | null;
|
|
340
|
+
},
|
|
341
|
+
Name
|
|
342
|
+
>;
|
|
343
|
+
listNamespaceVersions: FunctionReference<
|
|
344
|
+
"query",
|
|
345
|
+
"internal",
|
|
346
|
+
{
|
|
347
|
+
namespace: string;
|
|
348
|
+
paginationOpts: {
|
|
349
|
+
cursor: string | null;
|
|
350
|
+
endCursor?: string | null;
|
|
351
|
+
id?: number;
|
|
352
|
+
maximumBytesRead?: number;
|
|
353
|
+
maximumRowsRead?: number;
|
|
354
|
+
numItems: number;
|
|
355
|
+
};
|
|
356
|
+
},
|
|
357
|
+
{
|
|
358
|
+
continueCursor: string;
|
|
359
|
+
isDone: boolean;
|
|
360
|
+
page: Array<{
|
|
361
|
+
createdAt: number;
|
|
362
|
+
dimension: number;
|
|
363
|
+
filterNames: Array<string>;
|
|
364
|
+
modelId: string;
|
|
365
|
+
namespace: string;
|
|
366
|
+
namespaceId: string;
|
|
367
|
+
status: "pending" | "ready" | "replaced";
|
|
368
|
+
version: number;
|
|
369
|
+
}>;
|
|
370
|
+
pageStatus?: "SplitRecommended" | "SplitRequired" | null;
|
|
371
|
+
splitCursor?: string | null;
|
|
372
|
+
},
|
|
373
|
+
Name
|
|
374
|
+
>;
|
|
375
|
+
lookup: FunctionReference<
|
|
376
|
+
"query",
|
|
377
|
+
"internal",
|
|
378
|
+
{
|
|
379
|
+
dimension: number;
|
|
380
|
+
filterNames: Array<string>;
|
|
381
|
+
modelId: string;
|
|
382
|
+
namespace: string;
|
|
383
|
+
},
|
|
384
|
+
null | string,
|
|
385
|
+
Name
|
|
386
|
+
>;
|
|
387
|
+
promoteToReady: FunctionReference<
|
|
388
|
+
"mutation",
|
|
389
|
+
"internal",
|
|
390
|
+
{ namespaceId: string },
|
|
391
|
+
{
|
|
392
|
+
replacedNamespace: null | {
|
|
393
|
+
createdAt: number;
|
|
394
|
+
dimension: number;
|
|
395
|
+
filterNames: Array<string>;
|
|
396
|
+
modelId: string;
|
|
397
|
+
namespace: string;
|
|
398
|
+
namespaceId: string;
|
|
399
|
+
status: "pending" | "ready" | "replaced";
|
|
400
|
+
version: number;
|
|
401
|
+
};
|
|
402
|
+
},
|
|
403
|
+
Name
|
|
404
|
+
>;
|
|
405
|
+
};
|
|
406
|
+
search: {
|
|
407
|
+
search: FunctionReference<
|
|
408
|
+
"action",
|
|
409
|
+
"internal",
|
|
410
|
+
{
|
|
411
|
+
chunkContext?: { after: number; before: number };
|
|
412
|
+
embedding: Array<number>;
|
|
413
|
+
filters: Array<{ name: string; value: any }>;
|
|
414
|
+
limit: number;
|
|
415
|
+
modelId: string;
|
|
416
|
+
namespace: string;
|
|
417
|
+
vectorScoreThreshold?: number;
|
|
418
|
+
},
|
|
419
|
+
{
|
|
420
|
+
entries: Array<{
|
|
421
|
+
contentHash?: string;
|
|
422
|
+
entryId: string;
|
|
423
|
+
filterValues: Array<{ name: string; value: any }>;
|
|
424
|
+
importance: number;
|
|
425
|
+
key?: string;
|
|
426
|
+
metadata?: Record<string, any>;
|
|
427
|
+
replacedAt?: number;
|
|
428
|
+
status: "pending" | "ready" | "replaced";
|
|
429
|
+
title?: string;
|
|
430
|
+
}>;
|
|
431
|
+
results: Array<{
|
|
432
|
+
content: Array<{ metadata?: Record<string, any>; text: string }>;
|
|
433
|
+
entryId: string;
|
|
434
|
+
order: number;
|
|
435
|
+
score: number;
|
|
436
|
+
startOrder: number;
|
|
437
|
+
}>;
|
|
438
|
+
},
|
|
439
|
+
Name
|
|
440
|
+
>;
|
|
441
|
+
};
|
|
442
|
+
};
|