You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
message: "At least one vector field must be defined",
60
+
})
61
+
.describe(
62
+
"Definitions for the vector and filter fields to index, one definition per document. You must specify `vector` for fields that contain vector embeddings and `filter` for additional fields to filter on. At least one vector-type field definition is required."
63
+
),
64
+
})
65
+
.describe("Definition for a Vector Search index.");
66
+
67
+
privateatlasSearchIndexDefinition=z
68
+
.object({
69
+
type: z.literal("search"),
70
+
analyzer: z
71
+
.string()
72
+
.optional()
73
+
.default("lucene.standard")
74
+
.describe(
75
+
"The analyzer to use for the index. Can be one of the built-in lucene analyzers (`lucene.standard`, `lucene.simple`, `lucene.whitespace`, `lucene.keyword`), a language-specific analyzer, such as `lucene.cjk` or `lucene.czech`, or a custom analyzer defined in the Atlas UI."
76
+
),
77
+
mappings: z
78
+
.object({
79
+
dynamic: z
80
+
.boolean()
81
+
.optional()
82
+
.default(false)
83
+
.describe(
84
+
"Enables or disables dynamic mapping of fields for this index. If set to true, Atlas Search recursively indexes all dynamically indexable fields. If set to false, you must specify individual fields to index using mappings.fields."
85
+
),
86
+
fields: z
87
+
.record(
88
+
z.string().describe("The field name"),
89
+
z
90
+
.object({
91
+
type: z
92
+
.enum([
93
+
"autocomplete",
94
+
"boolean",
95
+
"date",
96
+
"document",
97
+
"embeddedDocuments",
98
+
"geo",
99
+
"number",
100
+
"objectId",
101
+
"string",
102
+
"token",
103
+
"uuid",
104
+
])
105
+
.describe("The field type"),
106
+
})
107
+
.passthrough()
48
108
.describe(
49
-
"Type of automatic vector quantization for your vectors. Use this setting only if your embeddings are float or double vectors."
50
-
),
51
-
})
52
-
.strict()
53
-
.describe("Definition for a field that contains vector embeddings."),
message: "At least one vector field must be defined",
59
-
})
60
-
.describe(
61
-
"Definitions for the vector and filter fields to index, one definition per document. You must specify `vector` for fields that contain vector embeddings and `filter` for additional fields to filter on. At least one vector-type field definition is required."
62
-
),
63
-
});
109
+
"The field index definition. It must contain the field type, as well as any additional options for that field type."
110
+
)
111
+
)
112
+
.optional()
113
+
.describe("The field mapping definitions. If `dynamic` is set to `false`, this is required."),
`Found 1 indexes in the collection "${collectionasstring}".`,
12
+
JSON.stringify({
13
+
name: "_id_",
14
+
key: {_id: 1},
15
+
})
16
+
),
17
+
};
18
+
},
19
+
};
20
+
4
21
describeAccuracyTests(
5
22
[
6
23
{
@@ -23,6 +40,7 @@ describeAccuracyTests(
23
40
},
24
41
},
25
42
],
43
+
mockedTools,
26
44
},
27
45
{
28
46
prompt: "Create a text index on title field in 'mflix.movies' namespace",
@@ -44,6 +62,7 @@ describeAccuracyTests(
44
62
},
45
63
},
46
64
],
65
+
mockedTools,
47
66
},
48
67
{
49
68
prompt: "Create a vector search index on 'mflix.movies' namespace on the 'plotSummary' field. The index should use 1024 dimensions.",
@@ -69,6 +88,7 @@ describeAccuracyTests(
69
88
},
70
89
},
71
90
],
91
+
mockedTools,
72
92
},
73
93
{
74
94
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.",
@@ -105,6 +125,7 @@ describeAccuracyTests(
105
125
},
106
126
},
107
127
],
128
+
mockedTools,
108
129
},
109
130
{
110
131
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.",
@@ -134,6 +155,95 @@ describeAccuracyTests(
134
155
},
135
156
},
136
157
],
158
+
mockedTools,
159
+
},
160
+
{
161
+
prompt: "Create an Atlas search index on 'mflix.movies' namespace with dynamic mappings enabled",
prompt: "Create an Atlas search index on 'mflix.movies' namespace with a custom 'lucene.keyword' analyzer, where 'title' is indexed as an autocomplete field and 'genres' as a string array field, and 'released' as a date field",
0 commit comments