chroma_update_documents
Modify documents in a Chroma collection by updating embeddings, metadatas, or text content. Ensure data integrity by matching input IDs with provided updates for accurate modifications.
Instructions
Update documents in a Chroma collection.
Args:
collection_name: Name of the collection to update documents in
ids: List of document IDs to update (required)
embeddings: Optional list of new embeddings for the documents.
Must match length of ids if provided.
metadatas: Optional list of new metadata dictionaries for the documents.
Must match length of ids if provided.
documents: Optional list of new text documents.
Must match length of ids if provided.
Returns:
A confirmation message indicating the number of documents updated.
Raises:
ValueError: If 'ids' is empty or if none of 'embeddings', 'metadatas',
or 'documents' are provided, or if the length of provided
update lists does not match the length of 'ids'.
Exception: If the collection does not exist or if the update operation fails.
Input Schema
Name | Required | Description | Default |
---|---|---|---|
collection_name | Yes | ||
documents | No | ||
embeddings | No | ||
ids | Yes | ||
metadatas | No |
Input Schema (JSON Schema)
{
"properties": {
"collection_name": {
"title": "Collection Name",
"type": "string"
},
"documents": {
"anyOf": [
{
"items": {
"type": "string"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"title": "Documents"
},
"embeddings": {
"anyOf": [
{
"items": {
"items": {
"type": "number"
},
"type": "array"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"title": "Embeddings"
},
"ids": {
"items": {
"type": "string"
},
"title": "Ids",
"type": "array"
},
"metadatas": {
"anyOf": [
{
"items": {
"additionalProperties": true,
"type": "object"
},
"type": "array"
},
{
"type": "null"
}
],
"default": null,
"title": "Metadatas"
}
},
"required": [
"collection_name",
"ids"
],
"title": "chroma_update_documentsArguments",
"type": "object"
}