@convex-dev/agent 0.1.0 → 0.1.1
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/commonjs/component/files.d.ts +18 -4
- package/dist/commonjs/component/files.d.ts.map +1 -1
- package/dist/commonjs/component/files.js +49 -5
- package/dist/commonjs/component/files.js.map +1 -1
- package/dist/commonjs/component/messages.d.ts +5 -5
- package/dist/commonjs/component/schema.d.ts +152 -48
- package/dist/commonjs/component/schema.d.ts.map +1 -1
- package/dist/commonjs/component/vector/index.d.ts +8 -8
- package/dist/commonjs/component/vector/index.d.ts.map +1 -1
- package/dist/commonjs/component/vector/tables.d.ts +5 -5
- package/dist/commonjs/component/vector/tables.d.ts.map +1 -1
- package/dist/commonjs/component/vector/tables.js +1 -1
- package/dist/commonjs/component/vector/tables.js.map +1 -1
- package/dist/commonjs/validators.d.ts +7 -7
- package/dist/esm/component/files.d.ts +18 -4
- package/dist/esm/component/files.d.ts.map +1 -1
- package/dist/esm/component/files.js +49 -5
- package/dist/esm/component/files.js.map +1 -1
- package/dist/esm/component/messages.d.ts +5 -5
- package/dist/esm/component/schema.d.ts +152 -48
- package/dist/esm/component/schema.d.ts.map +1 -1
- package/dist/esm/component/vector/index.d.ts +8 -8
- package/dist/esm/component/vector/index.d.ts.map +1 -1
- package/dist/esm/component/vector/tables.d.ts +5 -5
- package/dist/esm/component/vector/tables.d.ts.map +1 -1
- package/dist/esm/component/vector/tables.js +1 -1
- package/dist/esm/component/vector/tables.js.map +1 -1
- package/dist/esm/validators.d.ts +7 -7
- package/package.json +2 -2
- package/src/component/_generated/api.d.ts +33 -6
- package/src/component/files.ts +50 -5
- package/src/component/vector/tables.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/component/vector/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAY,WAAW,EAAS,MAAM,sBAAsB,CAAC;AAC/E,OAAO,EACL,mCAAmC,EAEnC,eAAe,EAIhB,MAAM,UAAU,CAAC;AAKlB,eAAO,MAAM,QAAQ;;;;;;;;;;GAmCnB,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;;;;GAqC/B,CAAC;AAEH,eAAO,MAAM,WAAW;;;;;;;;;iBAWtB,CAAC;AAEH,wBAAsB,YAAY,CAChC,GAAG,EAAE,WAAW,EAChB,SAAS,EAAE,eAAe,EAC1B,CAAC,EAAE,mCAAmC,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/component/vector/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,SAAS,EAAY,WAAW,EAAS,MAAM,sBAAsB,CAAC;AAC/E,OAAO,EACL,mCAAmC,EAEnC,eAAe,EAIhB,MAAM,UAAU,CAAC;AAKlB,eAAO,MAAM,QAAQ;;;;;;;;;;GAmCnB,CAAC;AAEH,eAAO,MAAM,oBAAoB;;;;;;;;;GAqC/B,CAAC;AAEH,eAAO,MAAM,WAAW;;;;;;;;;iBAWtB,CAAC;AAEH,wBAAsB,YAAY,CAChC,GAAG,EAAE,WAAW,EAChB,SAAS,EAAE,eAAe,EAC1B,CAAC,EAAE,mCAAmC,iPASvC;AAED,wBAAgB,aAAa,CAC3B,GAAG,EAAE,SAAS,EACd,MAAM,EAAE,MAAM,EAAE,EAChB,IAAI,EAAE;IACJ,SAAS,EAAE,eAAe,CAAC;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;;;KAgBF;AAED,eAAO,MAAM,WAAW;;;;;;iBAqBtB,CAAC;AAEH,eAAO,MAAM,WAAW;;iBAQtB,CAAC"}
|
|
@@ -39,19 +39,19 @@ type VectorIndex<D extends number> = {
|
|
|
39
39
|
export type VectorSchema = SchemaDefinition<{
|
|
40
40
|
[key in VectorTableName]: Table<128>;
|
|
41
41
|
}, true>;
|
|
42
|
-
export declare const VectorDimensions: readonly [128, 256, 512, 768, 1024, 1536, 2048, 3072, 4096];
|
|
42
|
+
export declare const VectorDimensions: readonly [128, 256, 512, 768, 1024, 1408, 1536, 2048, 3072, 4096];
|
|
43
43
|
export declare function validateVectorDimension(dimension: number): asserts dimension is VectorDimension;
|
|
44
44
|
export type VectorDimension = (typeof VectorDimensions)[number];
|
|
45
45
|
export declare const VectorTableNames: `embeddings_${(typeof VectorDimensions)[number]}`[];
|
|
46
46
|
export type VectorTableName = (typeof VectorTableNames)[number];
|
|
47
47
|
export type VectorTableId = GenericId<(typeof VectorTableNames)[number]>;
|
|
48
|
-
export declare const vVectorDimension: VUnion<128 | 256 | 512 | 768 | 1024 | 1536 | 2048 | 3072 | 4096, any, "required", any>;
|
|
49
|
-
export declare const vVectorTableName: VUnion<"embeddings_128" | "embeddings_256" | "embeddings_512" | "embeddings_768" | "embeddings_1024" | "embeddings_1536" | "embeddings_2048" | "embeddings_3072" | "embeddings_4096", any, "required", any>;
|
|
48
|
+
export declare const vVectorDimension: VUnion<128 | 256 | 512 | 768 | 1024 | 1408 | 1536 | 2048 | 3072 | 4096, any, "required", any>;
|
|
49
|
+
export declare const vVectorTableName: VUnion<"embeddings_128" | "embeddings_256" | "embeddings_512" | "embeddings_768" | "embeddings_1024" | "embeddings_1408" | "embeddings_1536" | "embeddings_2048" | "embeddings_3072" | "embeddings_4096", any, "required", any>;
|
|
50
50
|
export declare const vVectorId: VUnion<GenericId<(typeof VectorTableNames)[number]>, VId<(typeof VectorTableNames)[number]>[]>;
|
|
51
51
|
export declare function getVectorTableName(dimension: VectorDimension): VectorTableName;
|
|
52
52
|
export declare function getVectorIdInfo(ctx: QueryCtx, id: VectorTableId): {
|
|
53
|
-
tableName: "embeddings_128" | "embeddings_256" | "embeddings_512" | "embeddings_768" | "embeddings_1024" | "embeddings_1536" | "embeddings_2048" | "embeddings_3072" | "embeddings_4096";
|
|
54
|
-
dimension: 128 | 256 | 512 | 768 | 1024 | 1536 | 2048 | 3072 | 4096;
|
|
53
|
+
tableName: "embeddings_128" | "embeddings_256" | "embeddings_512" | "embeddings_768" | "embeddings_1024" | "embeddings_1408" | "embeddings_1536" | "embeddings_2048" | "embeddings_3072" | "embeddings_4096";
|
|
54
|
+
dimension: 128 | 256 | 512 | 768 | 1024 | 1408 | 1536 | 2048 | 3072 | 4096;
|
|
55
55
|
};
|
|
56
56
|
declare const tables: {
|
|
57
57
|
[K in keyof typeof VectorDimensions & number as `embeddings_${(typeof VectorDimensions)[K]}`]: Table<(typeof VectorDimensions)[K]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tables.d.ts","sourceRoot":"","sources":["../../../../src/component/vector/tables.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,yBAAyB,EACzB,gBAAgB,EAChB,eAAe,EAChB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,SAAS,EACT,KAAK,EACL,UAAU,EAEV,GAAG,EACH,OAAO,EACP,MAAM,EACP,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAGhD,QAAA,MAAM,UAAU;;;;;;;;CAUf,CAAC;AAEF,eAAO,MAAM,oCAAoC;;;;;;;;;;;;;;oHAEhD,CAAC;AACF,MAAM,MAAM,mCAAmC,GAAG,KAAK,CACrD,OAAO,oCAAoC,CAC5C,CAAC;AAYF,KAAK,KAAK,CAAC,CAAC,SAAS,MAAM,IAAI,eAAe,CAC5C,OAAO,CAAC,UAAU,CAAC,OAAO,UAAU,CAAC,EAAE,OAAO,UAAU,CAAC,EACzD;IAAE,oBAAoB,EAAE,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,eAAe,CAAC,CAAA;CAAE,EACzE,yBAAyB,EACzB,WAAW,CAAC,CAAC,CAAC,CACf,CAAC;AAEF,KAAK,WAAW,CAA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AC9D,CAAC,OAAO,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAC7B;CASF,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -25,7 +25,7 @@ function table(dimensions) {
|
|
|
25
25
|
.index("model_table_threadId", ["model", "table", "threadId"]);
|
|
26
26
|
}
|
|
27
27
|
export const VectorDimensions = [
|
|
28
|
-
128, 256, 512, 768, 1024, 1536, 2048, 3072, 4096,
|
|
28
|
+
128, 256, 512, 768, 1024, 1408, 1536, 2048, 3072, 4096,
|
|
29
29
|
];
|
|
30
30
|
export function validateVectorDimension(dimension) {
|
|
31
31
|
if (!VectorDimensions.includes(dimension)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tables.js","sourceRoot":"","sources":["../../../../src/component/vector/tables.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AACrD,OAAO,EACL,WAAW,GAIZ,MAAM,eAAe,CAAC;AACvB,OAAO,EAIL,CAAC,GAIF,MAAM,eAAe,CAAC;AAGvB,gEAAgE;AAChE,MAAM,UAAU,GAAG;IACjB,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,4DAA4D;IAC5D,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE;IACjB,MAAM,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IAC9B,QAAQ,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC;IAChC,8BAA8B;IAC9B,kBAAkB,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;IACnD,oBAAoB,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;IACrD,M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AG,CAClD,CAAC,CAAC,EAAE,EAAE,CAAC,cAAc,CAAC,EAAE,CAC8B,CAAC;AAIzD,MAAM,CAAC,MAAM,gBAAgB,GAAG,QAAQ,CAAC,GAAG,gBAAgB,CAAC,CAAC;AAC9D,MAAM,CAAC,MAAM,gBAAgB,GAAG,QAAQ,CAAC,GAAG,gBAAgB,CAAC,CAAC;AAC9D,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAC9B,GAAG,gBAAgB,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAI9C,CAAC;AAEF,MAAM,UAAU,kBAAkB,CAAC,SAA0B;IAC3D,OAAO,cAAc,SAAS,EAAqB,CAAC;AACtD,CAAC;AACD,MAAM,UAAU,eAAe,CAAC,GAAa,EAAE,EAAiB;IAC9D,KAAK,MAAM,SAAS,IAAI,gBAAgB,EAAE,CAAC;QACzC,MAAM,SAAS,GAAG,kBAAkB,CAAC,SAAS,CAAC,CAAC;QAChD,IAAI,GAAG,CAAC,EAAE,CAAC,WAAW,CAAC,SAAS,EAAE,EAAE,CAAC,EAAE,CAAC;YACtC,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,CAAC;QAClC,CAAC;IACH,CAAC;IACD,MAAM,IAAI,KAAK,CAAC,4BAA4B,EAAE,EAAE,CAAC,CAAC;AACpD,CAAC;AAED,MAAM,MAAM,GAKR,MAAM,CAAC,WAAW,CACpB,gBAAgB,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC;IACnC,cAAc,UAAU,EAAE;IAC1B,KAAK,CAAC,UAAU,CAAC;CAClB,CAAC,CAIH,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
package/dist/esm/validators.d.ts
CHANGED
|
@@ -2870,11 +2870,11 @@ export declare const vMessageWithMetadata: import("convex/values").VObject<{
|
|
|
2870
2870
|
export type MessageWithMetadata = Infer<typeof vMessageWithMetadata>;
|
|
2871
2871
|
export declare const vMessageEmbeddings: import("convex/values").VObject<{
|
|
2872
2872
|
model: string;
|
|
2873
|
-
dimension: 128 | 256 | 512 | 768 | 1024 | 1536 | 2048 | 3072 | 4096;
|
|
2873
|
+
dimension: 128 | 256 | 512 | 768 | 1024 | 1408 | 1536 | 2048 | 3072 | 4096;
|
|
2874
2874
|
vectors: (number[] | null)[];
|
|
2875
2875
|
}, {
|
|
2876
2876
|
model: import("convex/values").VString<string, "required">;
|
|
2877
|
-
dimension: import("convex/values").VUnion<128 | 256 | 512 | 768 | 1024 | 1536 | 2048 | 3072 | 4096, any, "required", any>;
|
|
2877
|
+
dimension: import("convex/values").VUnion<128 | 256 | 512 | 768 | 1024 | 1408 | 1536 | 2048 | 3072 | 4096, any, "required", any>;
|
|
2878
2878
|
vectors: import("convex/values").VArray<(number[] | null)[], import("convex/values").VUnion<number[] | null, [import("convex/values").VArray<number[], import("convex/values").VFloat64<number, "required">, "required">, import("convex/values").VNull<null, "required">], "required", never>, "required">;
|
|
2879
2879
|
}, "required", "model" | "dimension" | "vectors" | `dimension.${any}`>;
|
|
2880
2880
|
export declare const vStep: import("convex/values").VObject<{
|
|
@@ -3904,7 +3904,7 @@ export type Step = Infer<typeof vStep>;
|
|
|
3904
3904
|
export declare const vStepWithMessages: import("convex/values").VObject<{
|
|
3905
3905
|
embeddings?: {
|
|
3906
3906
|
model: string;
|
|
3907
|
-
dimension: 128 | 256 | 512 | 768 | 1024 | 1536 | 2048 | 3072 | 4096;
|
|
3907
|
+
dimension: 128 | 256 | 512 | 768 | 1024 | 1408 | 1536 | 2048 | 3072 | 4096;
|
|
3908
3908
|
vectors: (number[] | null)[];
|
|
3909
3909
|
} | undefined;
|
|
3910
3910
|
messages: {
|
|
@@ -5987,11 +5987,11 @@ export declare const vStepWithMessages: import("convex/values").VObject<{
|
|
|
5987
5987
|
}, "required", "id" | "error" | "model" | "provider" | "message" | "text" | "reasoning" | "files" | "usage" | "providerMetadata" | "sources" | "reasoningDetails" | "warnings" | "finishReason" | "message.providerOptions" | "message.role" | `message.providerOptions.${string}` | "message.content" | "usage.promptTokens" | "usage.completionTokens" | "usage.totalTokens" | `providerMetadata.${string}`>, "required">;
|
|
5988
5988
|
embeddings: import("convex/values").VObject<{
|
|
5989
5989
|
model: string;
|
|
5990
|
-
dimension: 128 | 256 | 512 | 768 | 1024 | 1536 | 2048 | 3072 | 4096;
|
|
5990
|
+
dimension: 128 | 256 | 512 | 768 | 1024 | 1408 | 1536 | 2048 | 3072 | 4096;
|
|
5991
5991
|
vectors: (number[] | null)[];
|
|
5992
5992
|
} | undefined, {
|
|
5993
5993
|
model: import("convex/values").VString<string, "required">;
|
|
5994
|
-
dimension: import("convex/values").VUnion<128 | 256 | 512 | 768 | 1024 | 1536 | 2048 | 3072 | 4096, any, "required", any>;
|
|
5994
|
+
dimension: import("convex/values").VUnion<128 | 256 | 512 | 768 | 1024 | 1408 | 1536 | 2048 | 3072 | 4096, any, "required", any>;
|
|
5995
5995
|
vectors: import("convex/values").VArray<(number[] | null)[], import("convex/values").VUnion<number[] | null, [import("convex/values").VArray<number[], import("convex/values").VFloat64<number, "required">, "required">, import("convex/values").VNull<null, "required">], "required", never>, "required">;
|
|
5996
5996
|
}, "optional", "model" | "dimension" | "vectors" | `dimension.${any}`>;
|
|
5997
5997
|
}, "required", "messages" | "step" | "step.text" | "step.reasoning" | "step.files" | "step.usage" | "step.providerMetadata" | "step.sources" | "step.reasoningDetails" | "step.warnings" | "step.finishReason" | "step.usage.promptTokens" | "step.usage.completionTokens" | "step.usage.totalTokens" | `step.providerMetadata.${string}` | "step.isContinued" | "step.logprobs" | "step.experimental_providerMetadata" | "step.request" | "step.response" | "step.stepType" | "step.toolCalls" | "step.toolResults" | `step.logprobs.${string}` | `step.experimental_providerMetadata.${string}` | "step.request.url" | "step.request.body" | "step.request.headers" | "step.request.method" | `step.request.body.${string}` | `step.request.headers.${string}` | "step.response.id" | "step.response.messages" | "step.response.body" | "step.response.headers" | `step.response.body.${string}` | `step.response.headers.${string}` | "step.response.timestamp" | "step.response.modelId" | "embeddings" | "embeddings.model" | "embeddings.dimension" | "embeddings.vectors" | `embeddings.dimension.${any}`>;
|
|
@@ -7538,11 +7538,11 @@ export declare const vSafeObjectArgs: import("convex/values").VObject<{
|
|
|
7538
7538
|
export type SafeObjectArgs = Infer<typeof vSafeObjectArgs>;
|
|
7539
7539
|
export declare const vEmbeddingsWithMetadata: import("convex/values").VObject<{
|
|
7540
7540
|
model: string;
|
|
7541
|
-
dimension: 128 | 256 | 512 | 768 | 1024 | 1536 | 2048 | 3072 | 4096;
|
|
7541
|
+
dimension: 128 | 256 | 512 | 768 | 1024 | 1408 | 1536 | 2048 | 3072 | 4096;
|
|
7542
7542
|
vectors: (number[] | null)[];
|
|
7543
7543
|
}, {
|
|
7544
7544
|
vectors: import("convex/values").VArray<(number[] | null)[], import("convex/values").VUnion<number[] | null, [import("convex/values").VArray<number[], import("convex/values").VFloat64<number, "required">, "required">, import("convex/values").VNull<null, "required">], "required", never>, "required">;
|
|
7545
|
-
dimension: import("convex/values").VUnion<128 | 256 | 512 | 768 | 1024 | 1536 | 2048 | 3072 | 4096, any, "required", any>;
|
|
7545
|
+
dimension: import("convex/values").VUnion<128 | 256 | 512 | 768 | 1024 | 1408 | 1536 | 2048 | 3072 | 4096, any, "required", any>;
|
|
7546
7546
|
model: import("convex/values").VString<string, "required">;
|
|
7547
7547
|
}, "required", "model" | "dimension" | "vectors" | `dimension.${any}`>;
|
|
7548
7548
|
export type EmbeddingsWithMetadata = Infer<typeof vEmbeddingsWithMetadata>;
|
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"email": "support@convex.dev",
|
|
8
8
|
"url": "https://github.com/get-convex/agent/issues"
|
|
9
9
|
},
|
|
10
|
-
"version": "0.1.
|
|
10
|
+
"version": "0.1.1",
|
|
11
11
|
"license": "Apache-2.0",
|
|
12
12
|
"keywords": [
|
|
13
13
|
"convex",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"test:watch": "vitest --typecheck",
|
|
32
32
|
"test:debug": "vitest --inspect-brk --no-file-parallelism",
|
|
33
33
|
"test:coverage": "vitest run --coverage --coverage.reporter=text",
|
|
34
|
-
"version": "pbcopy <<<$
|
|
34
|
+
"version": "pbcopy <<<$npm_package_version; vim CHANGELOG.md && git add CHANGELOG.md"
|
|
35
35
|
},
|
|
36
36
|
"files": [
|
|
37
37
|
"dist",
|
|
@@ -58,8 +58,9 @@ export type Mounts = {
|
|
|
58
58
|
"mutation",
|
|
59
59
|
"public",
|
|
60
60
|
{ hash: string; storageId: string },
|
|
61
|
-
string
|
|
61
|
+
{ fileId: string; storageIdUnused: boolean }
|
|
62
62
|
>;
|
|
63
|
+
copyFile: FunctionReference<"mutation", "public", { fileId: string }, null>;
|
|
63
64
|
getFilesToDelete: FunctionReference<
|
|
64
65
|
"query",
|
|
65
66
|
"public",
|
|
@@ -76,11 +77,11 @@ export type Mounts = {
|
|
|
76
77
|
isDone: boolean;
|
|
77
78
|
}
|
|
78
79
|
>;
|
|
79
|
-
|
|
80
|
+
useExistingFile: FunctionReference<
|
|
80
81
|
"mutation",
|
|
81
82
|
"public",
|
|
82
|
-
{
|
|
83
|
-
null
|
|
83
|
+
{ hash: string },
|
|
84
|
+
string | null
|
|
84
85
|
>;
|
|
85
86
|
};
|
|
86
87
|
messages: {
|
|
@@ -90,7 +91,17 @@ export type Mounts = {
|
|
|
90
91
|
{
|
|
91
92
|
agentName?: string;
|
|
92
93
|
embeddings?: {
|
|
93
|
-
dimension:
|
|
94
|
+
dimension:
|
|
95
|
+
| 128
|
|
96
|
+
| 256
|
|
97
|
+
| 512
|
|
98
|
+
| 768
|
|
99
|
+
| 1024
|
|
100
|
+
| 1408
|
|
101
|
+
| 1536
|
|
102
|
+
| 2048
|
|
103
|
+
| 3072
|
|
104
|
+
| 4096;
|
|
94
105
|
model: string;
|
|
95
106
|
vectors: Array<Array<number> | null>;
|
|
96
107
|
};
|
|
@@ -521,7 +532,17 @@ export type Mounts = {
|
|
|
521
532
|
promptMessageId: string;
|
|
522
533
|
step: {
|
|
523
534
|
embeddings?: {
|
|
524
|
-
dimension:
|
|
535
|
+
dimension:
|
|
536
|
+
| 128
|
|
537
|
+
| 256
|
|
538
|
+
| 512
|
|
539
|
+
| 768
|
|
540
|
+
| 1024
|
|
541
|
+
| 1408
|
|
542
|
+
| 1536
|
|
543
|
+
| 2048
|
|
544
|
+
| 3072
|
|
545
|
+
| 4096;
|
|
525
546
|
model: string;
|
|
526
547
|
vectors: Array<Array<number> | null>;
|
|
527
548
|
};
|
|
@@ -1853,6 +1874,7 @@ export type Mounts = {
|
|
|
1853
1874
|
| string
|
|
1854
1875
|
| string
|
|
1855
1876
|
| string
|
|
1877
|
+
| string
|
|
1856
1878
|
>;
|
|
1857
1879
|
},
|
|
1858
1880
|
null
|
|
@@ -1871,6 +1893,7 @@ export type Mounts = {
|
|
|
1871
1893
|
| 512
|
|
1872
1894
|
| 768
|
|
1873
1895
|
| 1024
|
|
1896
|
+
| 1408
|
|
1874
1897
|
| 1536
|
|
1875
1898
|
| 2048
|
|
1876
1899
|
| 3072
|
|
@@ -1888,6 +1911,7 @@ export type Mounts = {
|
|
|
1888
1911
|
| 512
|
|
1889
1912
|
| 768
|
|
1890
1913
|
| 1024
|
|
1914
|
+
| 1408
|
|
1891
1915
|
| 1536
|
|
1892
1916
|
| 2048
|
|
1893
1917
|
| 3072
|
|
@@ -1916,6 +1940,7 @@ export type Mounts = {
|
|
|
1916
1940
|
| 512
|
|
1917
1941
|
| 768
|
|
1918
1942
|
| 1024
|
|
1943
|
+
| 1408
|
|
1919
1944
|
| 1536
|
|
1920
1945
|
| 2048
|
|
1921
1946
|
| 3072
|
|
@@ -1933,6 +1958,7 @@ export type Mounts = {
|
|
|
1933
1958
|
| string
|
|
1934
1959
|
| string
|
|
1935
1960
|
| string
|
|
1961
|
+
| string
|
|
1936
1962
|
>;
|
|
1937
1963
|
isDone: boolean;
|
|
1938
1964
|
}
|
|
@@ -1951,6 +1977,7 @@ export type Mounts = {
|
|
|
1951
1977
|
| string
|
|
1952
1978
|
| string
|
|
1953
1979
|
| string
|
|
1980
|
+
| string
|
|
1954
1981
|
| string;
|
|
1955
1982
|
model: string;
|
|
1956
1983
|
vector: Array<number>;
|
package/src/component/files.ts
CHANGED
|
@@ -9,30 +9,75 @@ export const addFile = mutation({
|
|
|
9
9
|
hash: v.string(),
|
|
10
10
|
},
|
|
11
11
|
handler: addFileHandler,
|
|
12
|
-
returns:
|
|
12
|
+
returns: {
|
|
13
|
+
fileId: v.id("files"),
|
|
14
|
+
storageIdUnused: v.boolean(),
|
|
15
|
+
},
|
|
13
16
|
});
|
|
14
17
|
|
|
15
18
|
export async function addFileHandler(
|
|
16
19
|
ctx: MutationCtx,
|
|
17
20
|
args: { storageId: string; hash: string }
|
|
18
21
|
) {
|
|
22
|
+
const existingFile = await ctx.db
|
|
23
|
+
.query("files")
|
|
24
|
+
.withIndex("hash", (q) => q.eq("hash", args.hash))
|
|
25
|
+
.first();
|
|
26
|
+
if (existingFile) {
|
|
27
|
+
// increment the refcount
|
|
28
|
+
await ctx.db.patch(existingFile._id, {
|
|
29
|
+
refcount: existingFile.refcount + 1,
|
|
30
|
+
});
|
|
31
|
+
return {
|
|
32
|
+
fileId: existingFile._id,
|
|
33
|
+
storageIdUnused: existingFile.storageId !== args.storageId,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
19
36
|
const fileId = await ctx.db.insert("files", {
|
|
20
37
|
storageId: args.storageId,
|
|
21
38
|
hash: args.hash,
|
|
22
39
|
refcount: 1,
|
|
23
40
|
});
|
|
24
|
-
return
|
|
41
|
+
return {
|
|
42
|
+
fileId,
|
|
43
|
+
storageIdUnused: false,
|
|
44
|
+
};
|
|
25
45
|
}
|
|
26
46
|
|
|
27
|
-
|
|
47
|
+
/**
|
|
48
|
+
* If you plan to have the same file added over and over without a reference to
|
|
49
|
+
* the fileId, you can use this query to get the fileId of the existing file.
|
|
50
|
+
* And if it's
|
|
51
|
+
*/
|
|
52
|
+
export const useExistingFile = mutation({
|
|
53
|
+
args: {
|
|
54
|
+
hash: v.string(),
|
|
55
|
+
},
|
|
56
|
+
handler: async (ctx, args) => {
|
|
57
|
+
const file = await ctx.db
|
|
58
|
+
.query("files")
|
|
59
|
+
.withIndex("hash", (q) => q.eq("hash", args.hash))
|
|
60
|
+
.first();
|
|
61
|
+
if (!file) {
|
|
62
|
+
return null;
|
|
63
|
+
}
|
|
64
|
+
await ctx.db.patch(file._id, {
|
|
65
|
+
refcount: file.refcount + 1,
|
|
66
|
+
});
|
|
67
|
+
return file._id;
|
|
68
|
+
},
|
|
69
|
+
returns: v.union(v.id("files"), v.null()),
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
export const copyFile = mutation({
|
|
28
73
|
args: {
|
|
29
74
|
fileId: v.id("files"),
|
|
30
75
|
},
|
|
31
|
-
handler:
|
|
76
|
+
handler: copyFileHandler,
|
|
32
77
|
returns: v.null(),
|
|
33
78
|
});
|
|
34
79
|
|
|
35
|
-
export async function
|
|
80
|
+
export async function copyFileHandler(
|
|
36
81
|
ctx: MutationCtx,
|
|
37
82
|
args: { fileId: Id<"files"> }
|
|
38
83
|
) {
|
|
@@ -68,7 +68,7 @@ export type VectorSchema = SchemaDefinition<
|
|
|
68
68
|
>;
|
|
69
69
|
|
|
70
70
|
export const VectorDimensions = [
|
|
71
|
-
128, 256, 512, 768, 1024, 1536, 2048, 3072, 4096,
|
|
71
|
+
128, 256, 512, 768, 1024, 1408, 1536, 2048, 3072, 4096,
|
|
72
72
|
] as const;
|
|
73
73
|
export function validateVectorDimension(
|
|
74
74
|
dimension: number
|