File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 108108 * indexingMethod?: 'flat'|'hnsw',
109109 * hnswOptions?: array{maxEdges?: int, numEdgeCandidates?: int},
110110 * } | array{
111+ * type: 'autoEmbed',
112+ * modality: 'text',
113+ * path: string,
114+ * model: string,
115+ * numDimensions?: int,
116+ * quantization?: 'float'|'scalar'|'binary'|'binaryNoRescore',
117+ * similarity?: 'euclidean'|'cosine'|'dotProduct',
118+ * indexingMethod?: 'flat'|'hnsw',
119+ * hnswOptions?: array{maxEdges?: int, numEdgeCandidates?: int},
120+ * } | array{
111121 * type: 'filter',
112122 * path: string,
113123 * }
Original file line number Diff line number Diff line change @@ -229,5 +229,40 @@ public static function vectorSearchIndexExamples(): void
229229 ['type ' => 'filter ' , 'path ' => 'genres ' ],
230230 ],
231231 ]);
232+
233+ // autoEmbed - minimal definition
234+ // Source: https://www.mongodb.com/docs/atlas/atlas-vector-search/vector-search-type/#automated-embedding
235+ self ::assertVectorSearchIndexDefinition ([
236+ 'fields ' => [
237+ [
238+ 'type ' => 'autoEmbed ' ,
239+ 'modality ' => 'text ' ,
240+ 'path ' => 'description ' ,
241+ 'model ' => 'voyage-4 ' ,
242+ ],
243+ ],
244+ ]);
245+
246+ // autoEmbed - with optional tuning parameters
247+ // Source: https://www.mongodb.com/docs/atlas/atlas-vector-search/vector-search-type/#automated-embedding
248+ self ::assertVectorSearchIndexDefinition ([
249+ 'fields ' => [
250+ [
251+ 'type ' => 'autoEmbed ' ,
252+ 'modality ' => 'text ' ,
253+ 'path ' => 'description ' ,
254+ 'model ' => 'voyage-4-large ' ,
255+ 'numDimensions ' => 1024 ,
256+ 'quantization ' => 'scalar ' ,
257+ 'similarity ' => 'dotProduct ' ,
258+ 'indexingMethod ' => 'hnsw ' ,
259+ 'hnswOptions ' => [
260+ 'maxEdges ' => 32 ,
261+ 'numEdgeCandidates ' => 200 ,
262+ ],
263+ ],
264+ ['type ' => 'filter ' , 'path ' => 'genres ' ],
265+ ],
266+ ]);
232267 }
233268}
You can’t perform that action at this time.
0 commit comments