Skip to content

Commit 4efecc2

Browse files
chore: fix a few tests
1 parent 5ea6e22 commit 4efecc2

File tree

2 files changed

+63
-6
lines changed

2 files changed

+63
-6
lines changed

tests/accuracy/createIndex.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,12 @@ describeAccuracyTests(
4646
],
4747
},
4848
{
49-
prompt: "Create a vector search index on 'mydb.movies' namespace on the 'plotSummary' field. The index should use 1024 dimensions.",
49+
prompt: "Create a vector search index on 'mflix.movies' namespace on the 'plotSummary' field. The index should use 1024 dimensions.",
5050
expectedToolCalls: [
5151
{
5252
toolName: "create-index",
5353
parameters: {
54-
database: "mydb",
54+
database: "mflix",
5555
collection: "movies",
5656
name: Matcher.anyOf(Matcher.undefined, Matcher.string()),
5757
definition: [
@@ -71,12 +71,12 @@ describeAccuracyTests(
7171
],
7272
},
7373
{
74-
prompt: "Create a vector search index on 'mydb.movies' namespace with on the 'plotSummary' field and 'genre' field, both of which contain vector embeddings. Pick a sensible number of dimensions for a voyage 3.5 model.",
74+
prompt: "Create a vector search index on 'mflix.movies' namespace with on the 'plotSummary' field and 'genre' field, both of which contain vector embeddings. Pick a sensible number of dimensions for a voyage 3.5 model.",
7575
expectedToolCalls: [
7676
{
7777
toolName: "create-index",
7878
parameters: {
79-
database: "mydb",
79+
database: "mflix",
8080
collection: "movies",
8181
name: Matcher.anyOf(Matcher.undefined, Matcher.string()),
8282
definition: [
@@ -107,12 +107,12 @@ describeAccuracyTests(
107107
],
108108
},
109109
{
110-
prompt: "Create a vector search index on 'mydb.movies' namespace where the 'plotSummary' field is indexed as a 1024-dimensional vector and the 'releaseDate' field is indexed as a regular field.",
110+
prompt: "Create a vector search index on 'mflix.movies' namespace where the 'plotSummary' field is indexed as a 1024-dimensional vector and the 'releaseDate' field is indexed as a regular field.",
111111
expectedToolCalls: [
112112
{
113113
toolName: "create-index",
114114
parameters: {
115-
database: "mydb",
115+
database: "mflix",
116116
collection: "movies",
117117
name: Matcher.anyOf(Matcher.undefined, Matcher.string()),
118118
definition: [
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
/**
2+
* Accuracy tests for when the vector search feature flag is disabled.
3+
*
4+
* TODO: Remove this file once we permanently enable the vector search feature.
5+
*/
6+
import { describeAccuracyTests } from "./sdk/describeAccuracyTests.js";
7+
import { Matcher } from "./sdk/matcher.js";
8+
9+
describeAccuracyTests(
10+
[
11+
{
12+
prompt: "(vectorSearchDisabled) Create an index that covers the following query on 'mflix.movies' namespace - { \"release_year\": 1992 }",
13+
expectedToolCalls: [
14+
{
15+
toolName: "create-index",
16+
parameters: {
17+
database: "mflix",
18+
collection: "movies",
19+
name: Matcher.anyOf(Matcher.undefined, Matcher.string()),
20+
definition: [
21+
{
22+
type: Matcher.anyOf(Matcher.undefined, Matcher.value("classic")),
23+
keys: {
24+
release_year: 1,
25+
},
26+
},
27+
],
28+
},
29+
},
30+
],
31+
},
32+
{
33+
prompt: "(vectorSearchDisabled) Create a text index on title field in 'mflix.movies' namespace",
34+
expectedToolCalls: [
35+
{
36+
toolName: "create-index",
37+
parameters: {
38+
database: "mflix",
39+
collection: "movies",
40+
name: Matcher.anyOf(Matcher.undefined, Matcher.string()),
41+
definition: [
42+
{
43+
type: Matcher.anyOf(Matcher.undefined, Matcher.value("classic")),
44+
keys: {
45+
title: "text",
46+
},
47+
},
48+
],
49+
},
50+
},
51+
],
52+
},
53+
],
54+
{
55+
userConfig: { voyageApiKey: "" },
56+
}
57+
);

0 commit comments

Comments
 (0)