Skip to content

Commit 392b620

Browse files
chore: apply default before transform
1 parent 23810d5 commit 392b620

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/tools/mongodb/mongodbSchemas.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ export const zVoyageEmbeddingParameters = z.object({
1111
// stringified numbers which are then transformed to actual numbers.
1212
outputDimension: z
1313
.union([z.literal("256"), z.literal("512"), z.literal("1024"), z.literal("2048"), z.literal("4096")])
14+
.default("1024")
1415
.transform((value): number => Number.parseInt(value))
15-
.optional()
16-
.default("1024"),
16+
.optional(),
1717
outputDtype: z.enum(["float", "int8", "uint8", "binary", "ubinary"]).optional().default("float"),
1818
});
1919

@@ -25,8 +25,8 @@ export const zVoyageAPIParameters = zVoyageEmbeddingParameters
2525
// outputDimension schema to expect a union of numbers.
2626
outputDimension: z
2727
.union([z.literal(256), z.literal(512), z.literal(1024), z.literal(2048), z.literal(4096)])
28-
.optional()
29-
.default(1024),
28+
.default(1024)
29+
.optional(),
3030
inputType: z.enum(["query", "document"]),
3131
})
3232
.strip();

0 commit comments

Comments
 (0)