Document Collections

Add Document Chunks To Collection

POST
Add the specified document chunks to a document collection. Credal automatically runs the collection's embeddings model on each chunk.

Request

This endpoint expects an object.
documentId
UUIDRequired
documentCollectionId
UUIDRequired
chunks
list of stringsRequired
The document chunks to add to the document collection. Credal will run the collection's embeddings model on each chunk.
customMetadata
map from strings to stringsRequired
The custom metadata for the document. The fields must match the custom metadata schema for the document collection.
POST
1curl -X POST https://api.credal.ai/api/v0/documentCollections/addDocumentChunksToCollection \
2 -H "Authorization: Bearer <apiKey>" \
3 -H "Content-Type: application/json" \
4 -d '{
5 "documentId": "82e4b12a-6990-45d4-8ebd-85c00e030c24",
6 "documentCollectionId": "82e4b12a-6990-45d4-8ebd-85c00e030c24",
7 "chunks": [
8 "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
9 "Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.",
10 "Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur."
11 ],
12 "customMetadata": {
13 "customerName": "Credal",
14 "meetingDate": "2023-11-06T23:03:42.056Z"
15 }
16}'