@convex-dev/rag 0.1.7
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/LICENSE +201 -0
- package/README.md +371 -0
- package/dist/client/_generated/_ignore.d.ts +1 -0
- package/dist/client/_generated/_ignore.d.ts.map +1 -0
- package/dist/client/_generated/_ignore.js +3 -0
- package/dist/client/_generated/_ignore.js.map +1 -0
- package/dist/client/defaultChunker.d.ts +15 -0
- package/dist/client/defaultChunker.d.ts.map +1 -0
- package/dist/client/defaultChunker.js +148 -0
- package/dist/client/defaultChunker.js.map +1 -0
- package/dist/client/fileUtils.d.ts +24 -0
- package/dist/client/fileUtils.d.ts.map +1 -0
- package/dist/client/fileUtils.js +179 -0
- package/dist/client/fileUtils.js.map +1 -0
- package/dist/client/index.d.ts +442 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +597 -0
- package/dist/client/index.js.map +1 -0
- package/dist/client/types.d.ts +29 -0
- package/dist/client/types.d.ts.map +1 -0
- package/dist/client/types.js +2 -0
- package/dist/client/types.js.map +1 -0
- package/dist/component/_generated/api.d.ts +439 -0
- package/dist/component/_generated/api.d.ts.map +1 -0
- package/dist/component/_generated/api.js +22 -0
- package/dist/component/_generated/api.js.map +1 -0
- package/dist/component/_generated/dataModel.d.ts +60 -0
- package/dist/component/_generated/server.d.ts +149 -0
- package/dist/component/_generated/server.d.ts.map +1 -0
- package/dist/component/_generated/server.js +74 -0
- package/dist/component/_generated/server.js.map +1 -0
- package/dist/component/chunks.d.ts +139 -0
- package/dist/component/chunks.d.ts.map +1 -0
- package/dist/component/chunks.js +413 -0
- package/dist/component/chunks.js.map +1 -0
- package/dist/component/convex.config.d.ts +3 -0
- package/dist/component/convex.config.d.ts.map +1 -0
- package/dist/component/convex.config.js +6 -0
- package/dist/component/convex.config.js.map +1 -0
- package/dist/component/embeddings/importance.d.ts +21 -0
- package/dist/component/embeddings/importance.d.ts.map +1 -0
- package/dist/component/embeddings/importance.js +67 -0
- package/dist/component/embeddings/importance.js.map +1 -0
- package/dist/component/embeddings/index.d.ts +23 -0
- package/dist/component/embeddings/index.d.ts.map +1 -0
- package/dist/component/embeddings/index.js +54 -0
- package/dist/component/embeddings/index.js.map +1 -0
- package/dist/component/embeddings/tables.d.ts +39 -0
- package/dist/component/embeddings/tables.d.ts.map +1 -0
- package/dist/component/embeddings/tables.js +53 -0
- package/dist/component/embeddings/tables.js.map +1 -0
- package/dist/component/entries.d.ts +167 -0
- package/dist/component/entries.d.ts.map +1 -0
- package/dist/component/entries.js +409 -0
- package/dist/component/entries.js.map +1 -0
- package/dist/component/filters.d.ts +46 -0
- package/dist/component/filters.d.ts.map +1 -0
- package/dist/component/filters.js +72 -0
- package/dist/component/filters.js.map +1 -0
- package/dist/component/namespaces.d.ts +131 -0
- package/dist/component/namespaces.d.ts.map +1 -0
- package/dist/component/namespaces.js +222 -0
- package/dist/component/namespaces.js.map +1 -0
- package/dist/component/schema.d.ts +1697 -0
- package/dist/component/schema.d.ts.map +1 -0
- package/dist/component/schema.js +88 -0
- package/dist/component/schema.js.map +1 -0
- package/dist/component/search.d.ts +20 -0
- package/dist/component/search.d.ts.map +1 -0
- package/dist/component/search.js +69 -0
- package/dist/component/search.js.map +1 -0
- package/dist/package.json +3 -0
- package/dist/react/index.d.ts +2 -0
- package/dist/react/index.d.ts.map +1 -0
- package/dist/react/index.js +6 -0
- package/dist/react/index.js.map +1 -0
- package/dist/shared.d.ts +479 -0
- package/dist/shared.d.ts.map +1 -0
- package/dist/shared.js +98 -0
- package/dist/shared.js.map +1 -0
- package/package.json +97 -0
- package/src/client/_generated/_ignore.ts +1 -0
- package/src/client/defaultChunker.test.ts +243 -0
- package/src/client/defaultChunker.ts +183 -0
- package/src/client/fileUtils.ts +179 -0
- package/src/client/index.test.ts +475 -0
- package/src/client/index.ts +1125 -0
- package/src/client/setup.test.ts +28 -0
- package/src/client/types.ts +69 -0
- package/src/component/_generated/api.d.ts +439 -0
- package/src/component/_generated/api.js +23 -0
- package/src/component/_generated/dataModel.d.ts +60 -0
- package/src/component/_generated/server.d.ts +149 -0
- package/src/component/_generated/server.js +90 -0
- package/src/component/chunks.test.ts +915 -0
- package/src/component/chunks.ts +555 -0
- package/src/component/convex.config.ts +7 -0
- package/src/component/embeddings/importance.test.ts +249 -0
- package/src/component/embeddings/importance.ts +75 -0
- package/src/component/embeddings/index.test.ts +482 -0
- package/src/component/embeddings/index.ts +99 -0
- package/src/component/embeddings/tables.ts +114 -0
- package/src/component/entries.test.ts +341 -0
- package/src/component/entries.ts +546 -0
- package/src/component/filters.ts +119 -0
- package/src/component/namespaces.ts +299 -0
- package/src/component/schema.ts +106 -0
- package/src/component/search.test.ts +445 -0
- package/src/component/search.ts +97 -0
- package/src/component/setup.test.ts +5 -0
- package/src/react/index.ts +7 -0
- package/src/shared.ts +247 -0
- package/src/vitest.config.ts +7 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/// <reference types="vite/client" />
|
|
2
|
+
import { test } from "vitest";
|
|
3
|
+
import { convexTest } from "convex-test";
|
|
4
|
+
export const modules = import.meta.glob("./**/*.*s");
|
|
5
|
+
|
|
6
|
+
import {
|
|
7
|
+
defineSchema,
|
|
8
|
+
type GenericSchema,
|
|
9
|
+
type SchemaDefinition,
|
|
10
|
+
} from "convex/server";
|
|
11
|
+
import { type RAGComponent } from "./index.js";
|
|
12
|
+
import { componentsGeneric } from "convex/server";
|
|
13
|
+
import componentSchema from "../component/schema.js";
|
|
14
|
+
export { componentSchema };
|
|
15
|
+
export const componentModules = import.meta.glob("../component/**/*.ts");
|
|
16
|
+
|
|
17
|
+
export function initConvexTest<
|
|
18
|
+
Schema extends SchemaDefinition<GenericSchema, boolean>,
|
|
19
|
+
>(schema?: Schema) {
|
|
20
|
+
const t = convexTest(schema ?? defineSchema({}), modules);
|
|
21
|
+
t.registerComponent("rag", componentSchema, componentModules);
|
|
22
|
+
return t;
|
|
23
|
+
}
|
|
24
|
+
export const components = componentsGeneric() as unknown as {
|
|
25
|
+
rag: RAGComponent;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
test("setup", () => {});
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
Expand,
|
|
3
|
+
FunctionReference,
|
|
4
|
+
GenericActionCtx,
|
|
5
|
+
GenericDataModel,
|
|
6
|
+
GenericMutationCtx,
|
|
7
|
+
GenericQueryCtx,
|
|
8
|
+
StorageActionWriter,
|
|
9
|
+
StorageReader,
|
|
10
|
+
} from "convex/server";
|
|
11
|
+
import { type GenericId } from "convex/values";
|
|
12
|
+
import type { Mounts } from "../component/_generated/api.js";
|
|
13
|
+
|
|
14
|
+
// UseApi<typeof api> is an alternative that has jump-to-definition but is
|
|
15
|
+
// less stable and reliant on types within the component files, which can cause
|
|
16
|
+
// issues where passing `components.foo` doesn't match the argument
|
|
17
|
+
export type RAGComponent = UseApi<Mounts>;
|
|
18
|
+
|
|
19
|
+
// Type utils follow
|
|
20
|
+
|
|
21
|
+
export type RunQueryCtx = {
|
|
22
|
+
runQuery: GenericQueryCtx<GenericDataModel>["runQuery"];
|
|
23
|
+
};
|
|
24
|
+
export type RunMutationCtx = {
|
|
25
|
+
runQuery: GenericMutationCtx<GenericDataModel>["runQuery"];
|
|
26
|
+
runMutation: GenericMutationCtx<GenericDataModel>["runMutation"];
|
|
27
|
+
};
|
|
28
|
+
export type RunActionCtx = {
|
|
29
|
+
runQuery: GenericActionCtx<GenericDataModel>["runQuery"];
|
|
30
|
+
runMutation: GenericActionCtx<GenericDataModel>["runMutation"];
|
|
31
|
+
runAction: GenericActionCtx<GenericDataModel>["runAction"];
|
|
32
|
+
};
|
|
33
|
+
export type ActionCtx = RunActionCtx & {
|
|
34
|
+
storage: StorageActionWriter;
|
|
35
|
+
};
|
|
36
|
+
export type QueryCtx = RunQueryCtx & {
|
|
37
|
+
storage: StorageReader;
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export type OpaqueIds<T> =
|
|
41
|
+
T extends GenericId<infer _T>
|
|
42
|
+
? string
|
|
43
|
+
: T extends (infer U)[]
|
|
44
|
+
? OpaqueIds<U>[]
|
|
45
|
+
: T extends ArrayBuffer
|
|
46
|
+
? ArrayBuffer
|
|
47
|
+
: T extends object
|
|
48
|
+
? {
|
|
49
|
+
[K in keyof T]: OpaqueIds<T[K]>;
|
|
50
|
+
}
|
|
51
|
+
: T;
|
|
52
|
+
|
|
53
|
+
export type UseApi<API> = Expand<{
|
|
54
|
+
[mod in keyof API]: API[mod] extends FunctionReference<
|
|
55
|
+
infer FType,
|
|
56
|
+
"public",
|
|
57
|
+
infer FArgs,
|
|
58
|
+
infer FReturnType,
|
|
59
|
+
infer FComponentPath
|
|
60
|
+
>
|
|
61
|
+
? FunctionReference<
|
|
62
|
+
FType,
|
|
63
|
+
"internal",
|
|
64
|
+
OpaqueIds<FArgs>,
|
|
65
|
+
OpaqueIds<FReturnType>,
|
|
66
|
+
FComponentPath
|
|
67
|
+
>
|
|
68
|
+
: UseApi<API[mod]>;
|
|
69
|
+
}>;
|
|
@@ -0,0 +1,439 @@
|
|
|
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
|
+
|
|
26
|
+
/**
|
|
27
|
+
* A utility for referencing Convex functions in your app's API.
|
|
28
|
+
*
|
|
29
|
+
* Usage:
|
|
30
|
+
* ```js
|
|
31
|
+
* const myFunctionReference = api.myModule.myFunction;
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
declare const fullApi: ApiFromModules<{
|
|
35
|
+
chunks: typeof chunks;
|
|
36
|
+
"embeddings/importance": typeof embeddings_importance;
|
|
37
|
+
"embeddings/index": typeof embeddings_index;
|
|
38
|
+
"embeddings/tables": typeof embeddings_tables;
|
|
39
|
+
entries: typeof entries;
|
|
40
|
+
filters: typeof filters;
|
|
41
|
+
namespaces: typeof namespaces;
|
|
42
|
+
search: typeof search;
|
|
43
|
+
}>;
|
|
44
|
+
export type Mounts = {
|
|
45
|
+
chunks: {
|
|
46
|
+
insert: FunctionReference<
|
|
47
|
+
"mutation",
|
|
48
|
+
"public",
|
|
49
|
+
{
|
|
50
|
+
chunks: Array<{
|
|
51
|
+
content: { metadata?: Record<string, any>; text: string };
|
|
52
|
+
embedding: Array<number>;
|
|
53
|
+
searchableText?: string;
|
|
54
|
+
}>;
|
|
55
|
+
entryId: string;
|
|
56
|
+
startOrder: number;
|
|
57
|
+
},
|
|
58
|
+
{ status: "pending" | "ready" | "replaced" }
|
|
59
|
+
>;
|
|
60
|
+
list: FunctionReference<
|
|
61
|
+
"query",
|
|
62
|
+
"public",
|
|
63
|
+
{
|
|
64
|
+
entryId: string;
|
|
65
|
+
paginationOpts: {
|
|
66
|
+
cursor: string | null;
|
|
67
|
+
endCursor?: string | null;
|
|
68
|
+
id?: number;
|
|
69
|
+
maximumBytesRead?: number;
|
|
70
|
+
maximumRowsRead?: number;
|
|
71
|
+
numItems: number;
|
|
72
|
+
};
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
continueCursor: string;
|
|
76
|
+
isDone: boolean;
|
|
77
|
+
page: Array<{
|
|
78
|
+
metadata?: Record<string, any>;
|
|
79
|
+
order: number;
|
|
80
|
+
state: "pending" | "ready" | "replaced";
|
|
81
|
+
text: string;
|
|
82
|
+
}>;
|
|
83
|
+
pageStatus?: "SplitRecommended" | "SplitRequired" | null;
|
|
84
|
+
splitCursor?: string | null;
|
|
85
|
+
}
|
|
86
|
+
>;
|
|
87
|
+
replaceChunksPage: FunctionReference<
|
|
88
|
+
"mutation",
|
|
89
|
+
"public",
|
|
90
|
+
{ entryId: string; startOrder: number },
|
|
91
|
+
{ nextStartOrder: number; status: "pending" | "ready" | "replaced" }
|
|
92
|
+
>;
|
|
93
|
+
};
|
|
94
|
+
entries: {
|
|
95
|
+
add: FunctionReference<
|
|
96
|
+
"mutation",
|
|
97
|
+
"public",
|
|
98
|
+
{
|
|
99
|
+
allChunks?: Array<{
|
|
100
|
+
content: { metadata?: Record<string, any>; text: string };
|
|
101
|
+
embedding: Array<number>;
|
|
102
|
+
searchableText?: string;
|
|
103
|
+
}>;
|
|
104
|
+
entry: {
|
|
105
|
+
contentHash?: string;
|
|
106
|
+
filterValues: Array<{ name: string; value: any }>;
|
|
107
|
+
importance: number;
|
|
108
|
+
key?: string;
|
|
109
|
+
metadata?: Record<string, any>;
|
|
110
|
+
namespaceId: string;
|
|
111
|
+
title?: string;
|
|
112
|
+
};
|
|
113
|
+
onComplete?: string;
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
created: boolean;
|
|
117
|
+
entryId: string;
|
|
118
|
+
replacedVersion: {
|
|
119
|
+
contentHash?: string;
|
|
120
|
+
entryId: string;
|
|
121
|
+
filterValues: Array<{ name: string; value: any }>;
|
|
122
|
+
importance: number;
|
|
123
|
+
key?: string;
|
|
124
|
+
metadata?: Record<string, any>;
|
|
125
|
+
status: "pending" | "ready" | "replaced";
|
|
126
|
+
title?: string;
|
|
127
|
+
} | null;
|
|
128
|
+
status: "pending" | "ready" | "replaced";
|
|
129
|
+
}
|
|
130
|
+
>;
|
|
131
|
+
addAsync: FunctionReference<
|
|
132
|
+
"mutation",
|
|
133
|
+
"public",
|
|
134
|
+
{
|
|
135
|
+
chunker: string;
|
|
136
|
+
entry: {
|
|
137
|
+
contentHash?: string;
|
|
138
|
+
filterValues: Array<{ name: string; value: any }>;
|
|
139
|
+
importance: number;
|
|
140
|
+
key?: string;
|
|
141
|
+
metadata?: Record<string, any>;
|
|
142
|
+
namespaceId: string;
|
|
143
|
+
title?: string;
|
|
144
|
+
};
|
|
145
|
+
onComplete?: string;
|
|
146
|
+
},
|
|
147
|
+
{ created: boolean; entryId: string; status: "pending" | "ready" }
|
|
148
|
+
>;
|
|
149
|
+
deleteAsync: FunctionReference<
|
|
150
|
+
"mutation",
|
|
151
|
+
"public",
|
|
152
|
+
{ entryId: string; startOrder: number },
|
|
153
|
+
null
|
|
154
|
+
>;
|
|
155
|
+
findByContentHash: FunctionReference<
|
|
156
|
+
"query",
|
|
157
|
+
"public",
|
|
158
|
+
{
|
|
159
|
+
contentHash: string;
|
|
160
|
+
dimension: number;
|
|
161
|
+
filterNames: Array<string>;
|
|
162
|
+
key: string;
|
|
163
|
+
modelId: string;
|
|
164
|
+
namespace: string;
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
contentHash?: string;
|
|
168
|
+
entryId: string;
|
|
169
|
+
filterValues: Array<{ name: string; value: any }>;
|
|
170
|
+
importance: number;
|
|
171
|
+
key?: string;
|
|
172
|
+
metadata?: Record<string, any>;
|
|
173
|
+
status: "pending" | "ready" | "replaced";
|
|
174
|
+
title?: string;
|
|
175
|
+
} | null
|
|
176
|
+
>;
|
|
177
|
+
get: FunctionReference<
|
|
178
|
+
"query",
|
|
179
|
+
"public",
|
|
180
|
+
{ entryId: string },
|
|
181
|
+
{
|
|
182
|
+
contentHash?: string;
|
|
183
|
+
entryId: string;
|
|
184
|
+
filterValues: Array<{ name: string; value: any }>;
|
|
185
|
+
importance: number;
|
|
186
|
+
key?: string;
|
|
187
|
+
metadata?: Record<string, any>;
|
|
188
|
+
status: "pending" | "ready" | "replaced";
|
|
189
|
+
title?: string;
|
|
190
|
+
} | null
|
|
191
|
+
>;
|
|
192
|
+
list: FunctionReference<
|
|
193
|
+
"query",
|
|
194
|
+
"public",
|
|
195
|
+
{
|
|
196
|
+
namespaceId: string;
|
|
197
|
+
order?: "desc" | "asc";
|
|
198
|
+
paginationOpts: {
|
|
199
|
+
cursor: string | null;
|
|
200
|
+
endCursor?: string | null;
|
|
201
|
+
id?: number;
|
|
202
|
+
maximumBytesRead?: number;
|
|
203
|
+
maximumRowsRead?: number;
|
|
204
|
+
numItems: number;
|
|
205
|
+
};
|
|
206
|
+
status: "pending" | "ready" | "replaced";
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
continueCursor: string;
|
|
210
|
+
isDone: boolean;
|
|
211
|
+
page: Array<{
|
|
212
|
+
contentHash?: string;
|
|
213
|
+
entryId: string;
|
|
214
|
+
filterValues: Array<{ name: string; value: any }>;
|
|
215
|
+
importance: number;
|
|
216
|
+
key?: string;
|
|
217
|
+
metadata?: Record<string, any>;
|
|
218
|
+
status: "pending" | "ready" | "replaced";
|
|
219
|
+
title?: string;
|
|
220
|
+
}>;
|
|
221
|
+
pageStatus?: "SplitRecommended" | "SplitRequired" | null;
|
|
222
|
+
splitCursor?: string | null;
|
|
223
|
+
}
|
|
224
|
+
>;
|
|
225
|
+
promoteToReady: FunctionReference<
|
|
226
|
+
"mutation",
|
|
227
|
+
"public",
|
|
228
|
+
{ entryId: string },
|
|
229
|
+
{
|
|
230
|
+
replacedVersion: {
|
|
231
|
+
contentHash?: string;
|
|
232
|
+
entryId: string;
|
|
233
|
+
filterValues: Array<{ name: string; value: any }>;
|
|
234
|
+
importance: number;
|
|
235
|
+
key?: string;
|
|
236
|
+
metadata?: Record<string, any>;
|
|
237
|
+
status: "pending" | "ready" | "replaced";
|
|
238
|
+
title?: string;
|
|
239
|
+
} | null;
|
|
240
|
+
}
|
|
241
|
+
>;
|
|
242
|
+
};
|
|
243
|
+
namespaces: {
|
|
244
|
+
get: FunctionReference<
|
|
245
|
+
"query",
|
|
246
|
+
"public",
|
|
247
|
+
{
|
|
248
|
+
dimension: number;
|
|
249
|
+
filterNames: Array<string>;
|
|
250
|
+
modelId: string;
|
|
251
|
+
namespace: string;
|
|
252
|
+
},
|
|
253
|
+
null | {
|
|
254
|
+
createdAt: number;
|
|
255
|
+
dimension: number;
|
|
256
|
+
filterNames: Array<string>;
|
|
257
|
+
modelId: string;
|
|
258
|
+
namespace: string;
|
|
259
|
+
namespaceId: string;
|
|
260
|
+
status: "pending" | "ready" | "replaced";
|
|
261
|
+
version: number;
|
|
262
|
+
}
|
|
263
|
+
>;
|
|
264
|
+
getOrCreate: FunctionReference<
|
|
265
|
+
"mutation",
|
|
266
|
+
"public",
|
|
267
|
+
{
|
|
268
|
+
dimension: number;
|
|
269
|
+
filterNames: Array<string>;
|
|
270
|
+
modelId: string;
|
|
271
|
+
namespace: string;
|
|
272
|
+
onComplete?: string;
|
|
273
|
+
status: "pending" | "ready";
|
|
274
|
+
},
|
|
275
|
+
{ namespaceId: string; status: "pending" | "ready" }
|
|
276
|
+
>;
|
|
277
|
+
list: FunctionReference<
|
|
278
|
+
"query",
|
|
279
|
+
"public",
|
|
280
|
+
{
|
|
281
|
+
paginationOpts: {
|
|
282
|
+
cursor: string | null;
|
|
283
|
+
endCursor?: string | null;
|
|
284
|
+
id?: number;
|
|
285
|
+
maximumBytesRead?: number;
|
|
286
|
+
maximumRowsRead?: number;
|
|
287
|
+
numItems: number;
|
|
288
|
+
};
|
|
289
|
+
status: "pending" | "ready" | "replaced";
|
|
290
|
+
},
|
|
291
|
+
{
|
|
292
|
+
continueCursor: string;
|
|
293
|
+
isDone: boolean;
|
|
294
|
+
page: Array<{
|
|
295
|
+
createdAt: number;
|
|
296
|
+
dimension: number;
|
|
297
|
+
filterNames: Array<string>;
|
|
298
|
+
modelId: string;
|
|
299
|
+
namespace: string;
|
|
300
|
+
namespaceId: string;
|
|
301
|
+
status: "pending" | "ready" | "replaced";
|
|
302
|
+
version: number;
|
|
303
|
+
}>;
|
|
304
|
+
pageStatus?: "SplitRecommended" | "SplitRequired" | null;
|
|
305
|
+
splitCursor?: string | null;
|
|
306
|
+
}
|
|
307
|
+
>;
|
|
308
|
+
lookup: FunctionReference<
|
|
309
|
+
"query",
|
|
310
|
+
"public",
|
|
311
|
+
{
|
|
312
|
+
dimension: number;
|
|
313
|
+
filterNames: Array<string>;
|
|
314
|
+
modelId: string;
|
|
315
|
+
namespace: string;
|
|
316
|
+
},
|
|
317
|
+
null | string
|
|
318
|
+
>;
|
|
319
|
+
promoteToReady: FunctionReference<
|
|
320
|
+
"mutation",
|
|
321
|
+
"public",
|
|
322
|
+
{ namespaceId: string },
|
|
323
|
+
{
|
|
324
|
+
replacedVersion: null | {
|
|
325
|
+
createdAt: number;
|
|
326
|
+
dimension: number;
|
|
327
|
+
filterNames: Array<string>;
|
|
328
|
+
modelId: string;
|
|
329
|
+
namespace: string;
|
|
330
|
+
namespaceId: string;
|
|
331
|
+
status: "pending" | "ready" | "replaced";
|
|
332
|
+
version: number;
|
|
333
|
+
};
|
|
334
|
+
}
|
|
335
|
+
>;
|
|
336
|
+
};
|
|
337
|
+
search: {
|
|
338
|
+
search: FunctionReference<
|
|
339
|
+
"action",
|
|
340
|
+
"public",
|
|
341
|
+
{
|
|
342
|
+
chunkContext?: { after: number; before: number };
|
|
343
|
+
embedding: Array<number>;
|
|
344
|
+
filters: Array<{ name: string; value: any }>;
|
|
345
|
+
limit: number;
|
|
346
|
+
modelId: string;
|
|
347
|
+
namespace: string;
|
|
348
|
+
vectorScoreThreshold?: number;
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
entries: Array<{
|
|
352
|
+
contentHash?: string;
|
|
353
|
+
entryId: string;
|
|
354
|
+
filterValues: Array<{ name: string; value: any }>;
|
|
355
|
+
importance: number;
|
|
356
|
+
key?: string;
|
|
357
|
+
metadata?: Record<string, any>;
|
|
358
|
+
status: "pending" | "ready" | "replaced";
|
|
359
|
+
title?: string;
|
|
360
|
+
}>;
|
|
361
|
+
results: Array<{
|
|
362
|
+
content: Array<{ metadata?: Record<string, any>; text: string }>;
|
|
363
|
+
entryId: string;
|
|
364
|
+
order: number;
|
|
365
|
+
score: number;
|
|
366
|
+
startOrder: number;
|
|
367
|
+
}>;
|
|
368
|
+
}
|
|
369
|
+
>;
|
|
370
|
+
};
|
|
371
|
+
};
|
|
372
|
+
// For now fullApiWithMounts is only fullApi which provides
|
|
373
|
+
// jump-to-definition in component client code.
|
|
374
|
+
// Use Mounts for the same type without the inference.
|
|
375
|
+
declare const fullApiWithMounts: typeof fullApi;
|
|
376
|
+
|
|
377
|
+
export declare const api: FilterApi<
|
|
378
|
+
typeof fullApiWithMounts,
|
|
379
|
+
FunctionReference<any, "public">
|
|
380
|
+
>;
|
|
381
|
+
export declare const internal: FilterApi<
|
|
382
|
+
typeof fullApiWithMounts,
|
|
383
|
+
FunctionReference<any, "internal">
|
|
384
|
+
>;
|
|
385
|
+
|
|
386
|
+
export declare const components: {
|
|
387
|
+
workpool: {
|
|
388
|
+
lib: {
|
|
389
|
+
cancel: FunctionReference<
|
|
390
|
+
"mutation",
|
|
391
|
+
"internal",
|
|
392
|
+
{
|
|
393
|
+
id: string;
|
|
394
|
+
logLevel: "DEBUG" | "TRACE" | "INFO" | "REPORT" | "WARN" | "ERROR";
|
|
395
|
+
},
|
|
396
|
+
any
|
|
397
|
+
>;
|
|
398
|
+
cancelAll: FunctionReference<
|
|
399
|
+
"mutation",
|
|
400
|
+
"internal",
|
|
401
|
+
{
|
|
402
|
+
before?: number;
|
|
403
|
+
logLevel: "DEBUG" | "TRACE" | "INFO" | "REPORT" | "WARN" | "ERROR";
|
|
404
|
+
},
|
|
405
|
+
any
|
|
406
|
+
>;
|
|
407
|
+
enqueue: FunctionReference<
|
|
408
|
+
"mutation",
|
|
409
|
+
"internal",
|
|
410
|
+
{
|
|
411
|
+
config: {
|
|
412
|
+
logLevel: "DEBUG" | "TRACE" | "INFO" | "REPORT" | "WARN" | "ERROR";
|
|
413
|
+
maxParallelism: number;
|
|
414
|
+
};
|
|
415
|
+
fnArgs: any;
|
|
416
|
+
fnHandle: string;
|
|
417
|
+
fnName: string;
|
|
418
|
+
fnType: "action" | "mutation" | "query";
|
|
419
|
+
onComplete?: { context?: any; fnHandle: string };
|
|
420
|
+
retryBehavior?: {
|
|
421
|
+
base: number;
|
|
422
|
+
initialBackoffMs: number;
|
|
423
|
+
maxAttempts: number;
|
|
424
|
+
};
|
|
425
|
+
runAt: number;
|
|
426
|
+
},
|
|
427
|
+
string
|
|
428
|
+
>;
|
|
429
|
+
status: FunctionReference<
|
|
430
|
+
"query",
|
|
431
|
+
"internal",
|
|
432
|
+
{ id: string },
|
|
433
|
+
| { previousAttempts: number; state: "pending" }
|
|
434
|
+
| { previousAttempts: number; state: "running" }
|
|
435
|
+
| { state: "finished" }
|
|
436
|
+
>;
|
|
437
|
+
};
|
|
438
|
+
};
|
|
439
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
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 { anyApi, componentsGeneric } from "convex/server";
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* A utility for referencing Convex functions in your app's API.
|
|
15
|
+
*
|
|
16
|
+
* Usage:
|
|
17
|
+
* ```js
|
|
18
|
+
* const myFunctionReference = api.myModule.myFunction;
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export const api = anyApi;
|
|
22
|
+
export const internal = anyApi;
|
|
23
|
+
export const components = componentsGeneric();
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
/**
|
|
3
|
+
* Generated data model types.
|
|
4
|
+
*
|
|
5
|
+
* THIS CODE IS AUTOMATICALLY GENERATED.
|
|
6
|
+
*
|
|
7
|
+
* To regenerate, run `npx convex dev`.
|
|
8
|
+
* @module
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import type {
|
|
12
|
+
DataModelFromSchemaDefinition,
|
|
13
|
+
DocumentByName,
|
|
14
|
+
TableNamesInDataModel,
|
|
15
|
+
SystemTableNames,
|
|
16
|
+
} from "convex/server";
|
|
17
|
+
import type { GenericId } from "convex/values";
|
|
18
|
+
import schema from "../schema.js";
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* The names of all of your Convex tables.
|
|
22
|
+
*/
|
|
23
|
+
export type TableNames = TableNamesInDataModel<DataModel>;
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* The type of a document stored in Convex.
|
|
27
|
+
*
|
|
28
|
+
* @typeParam TableName - A string literal type of the table name (like "users").
|
|
29
|
+
*/
|
|
30
|
+
export type Doc<TableName extends TableNames> = DocumentByName<
|
|
31
|
+
DataModel,
|
|
32
|
+
TableName
|
|
33
|
+
>;
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* An identifier for a document in Convex.
|
|
37
|
+
*
|
|
38
|
+
* Convex documents are uniquely identified by their `Id`, which is accessible
|
|
39
|
+
* on the `_id` field. To learn more, see [Document IDs](https://docs.convex.dev/using/document-ids).
|
|
40
|
+
*
|
|
41
|
+
* Documents can be loaded using `db.get(id)` in query and mutation functions.
|
|
42
|
+
*
|
|
43
|
+
* IDs are just strings at runtime, but this type can be used to distinguish them from other
|
|
44
|
+
* strings when type checking.
|
|
45
|
+
*
|
|
46
|
+
* @typeParam TableName - A string literal type of the table name (like "users").
|
|
47
|
+
*/
|
|
48
|
+
export type Id<TableName extends TableNames | SystemTableNames> =
|
|
49
|
+
GenericId<TableName>;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* A type describing your Convex data model.
|
|
53
|
+
*
|
|
54
|
+
* This type includes information about what tables you have, the type of
|
|
55
|
+
* documents stored in those tables, and the indexes defined on them.
|
|
56
|
+
*
|
|
57
|
+
* This type is used to parameterize methods like `queryGeneric` and
|
|
58
|
+
* `mutationGeneric` to make them type-safe.
|
|
59
|
+
*/
|
|
60
|
+
export type DataModel = DataModelFromSchemaDefinition<typeof schema>;
|