Skip to content

Commit 8c796ed

Browse files
committed
chore: fix accuracy tests and add defaults
1 parent 85e9cf2 commit 8c796ed

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

src/common/search/embeddingsProvider.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,16 @@ interface EmbeddingsProvider<SupportedModels extends string, SupportedEmbeddingP
2020
): Promise<Embeddings[]>;
2121
}
2222

23-
export const zVoyageModels = z.enum(["voyage-3-large", "voyage-3.5", "voyage-3.5-lite", "voyage-code-3"]);
23+
export const zVoyageModels = z
24+
.enum(["voyage-3-large", "voyage-3.5", "voyage-3.5-lite", "voyage-code-3"])
25+
.default("voyage-3-large");
26+
2427
export const zVoyageEmbeddingParameters = z.object({
25-
outputDimension: z.union([z.literal(256), z.literal(512), z.literal(1024), z.literal(2048), z.literal(4096)]),
26-
outputDType: z.enum(["float", "int8", "uint8", "binary", "ubinary"]),
28+
outputDimension: z
29+
.union([z.literal(256), z.literal(512), z.literal(1024), z.literal(2048), z.literal(4096)])
30+
.optional()
31+
.default(1024),
32+
outputDType: z.enum(["float", "int8", "uint8", "binary", "ubinary"]).optional().default("float"),
2733
});
2834

2935
type VoyageModels = z.infer<typeof zVoyageModels>;

tests/accuracy/aggregate.test.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,9 @@ describeAccuracyTests([
4848
index: "titles",
4949
path: "title_embeddings",
5050
queryVector: "hammer of justice",
51-
embeddingModel: "voyage-3-large",
51+
embeddingParameters: {
52+
model: "voyage-3-large",
53+
},
5254
},
5355
},
5456
],
@@ -103,7 +105,9 @@ describeAccuracyTests([
103105
index: "my-index",
104106
path: "plot_embeddings",
105107
queryVector: "sci-fy",
106-
embeddingModel: "voyage-3-large",
108+
embeddingParameters: {
109+
model: "voyage-3-large",
110+
},
107111
},
108112
},
109113
],

0 commit comments

Comments
 (0)