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",
62
-
})
63
-
.describe(
64
-
"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."
"Array of objects with vector search index fields as keys (in dot notation) and the raw text values to generate embeddings for as values. The index of each object corresponds to the index of the document in the documents array."
15
+
"Array of objects with indexed field paths as keys (in dot notation) and the raw text values to generate embeddings for as values. Only provide fields that require embeddings to be generated; do not include fields that are covered by auto-embedding indexes. The index of each object corresponds to the index of the document in the documents array."
16
16
),
17
17
});
18
18
@@ -34,7 +34,7 @@ export class InsertManyTool extends MongoDBToolBase {
"The embedding model and its parameters to use to generate embeddingsfor fields with vector search indexes. Note to LLM: If unsure which embedding model to use, ask the user before providing one."
37
+
"The embedding model and its parameters to use to generate embeddings. Only provide this for fields where you need to generate embeddings; do not include fields that have auto-embedding indexes configured, as MongoDB will automatically generate embeddings for those. Note to LLM: If unsure which embedding model to use, ask the user before providing one."
38
38
),
39
39
}
40
40
: commonArgs;
@@ -93,7 +93,9 @@ export class InsertManyTool extends MongoDBToolBase {
93
93
returndocuments;
94
94
}
95
95
96
-
// Get vector search indexes for the collection
96
+
// Get vector search indexes for the collection.
97
+
// Note: embeddingsForNamespace() only returns fields that require manual embedding generation,
98
+
// excluding fields with auto-embedding indexes where MongoDB generates embeddings automatically.
`Field '${fieldPath}' does not have a vector search index in collection ${database}.${collection}. Only fields with vector search indexes can have embeddings generated.`
110
+
`Field '${fieldPath}' does not have a vector search index configured for manual embedding generation in collection ${database}.${collection}. This field either has no index or has an auto-embedding index where MongoDB generates embeddings automatically.`
"The content to search for when querying indexes that require manual embedding generation. Provide an array of numbers (embeddings) or a string with embeddingParameters. Do not use this for auto-embedding indexes; use 'query' instead."
66
+
),
67
+
query: z
68
+
.object({
69
+
text: z.string().describe("The text query to search for."),
70
+
})
71
+
.optional()
63
72
.describe(
64
-
"The content to search for. The embeddingParameters field is mandatory if the queryVector is a string, in that case, the tool generates the embedding automatically using the provided configuration."
73
+
"The query to search for when using auto-embedding indexes. MongoDB will automatically generate embeddings for the text. Use this for auto-embedding indexes, not 'queryVector'."
"The embedding model and its parameters to use to generate embeddings before searching. It is mandatory if queryVector is a string value. Note to LLM: If unsure, ask the user before providing one."
90
+
"The embedding model and its parameters to use to generate embeddings before searching. Only provide this when using 'queryVector' with a string value for indexes that require manual embedding generation. Do not provide this for auto-embedding indexes that use 'query'. Note to LLM: If unsure, ask the user before providing one."
0 commit comments