Store Context
If you choose to encrypt your inputs, you may use the guidelines here to generate an encryption key:
Embed and store inputs as context, for later retrieval. Inputs are chunked and embedded, and the embeddings are stored in the context database. The context can be used for similarity search.
Unique identifier of your project. Every project is stored as a separate collection in Unibrain, so that all the contexts belonging to a project are grouped together. If you are supplying a new project ID, a new collection will be created for you. You can have a maximum of 4096 unique projects in Unibrain.
Type of input. Currently, only text is supported.
text
Possible values: Array of input texts. Each input text is chunked and embedded separately. The embeddings are stored in the context database. The context can be used for similarity search.
Whether to encrypt the input texts before storing them in the context database. If true, you must provide an encryption key. The encryption key is used to encrypt the input texts before storing them in the context database. The encryption key is not stored by Unibrain, so you must store it securely. If you lose the encryption key, you will not be able to decrypt the input texts later.
false
Encryption key to use when encrypting the input texts. The encryption key is used to encrypt the input texts before storing them in the context database. The encryption key is not stored by Unibrain, so you must store it securely. If you lose the encryption key, you will not be able to decrypt the input texts later.
Accepted
POST /context HTTP/1.1
Host: api.unibrain.ai
X-API-Key: YOUR_API_KEY
Content-Type: application/json
Accept: */*
Content-Length: 157
{
"project_id": "text",
"metadata": {
"ANY_ADDITIONAL_PROPERTY": "text"
},
"input_type": "text",
"input_texts": [
"text"
],
"encrypt_inputs": false,
"encryption_key": "text"
}
Accepted
{
"context": {
"status": 1,
"message": "Error",
"timestamp": 1
},
"data": {
"document_ids": [
"123e4567-e89b-12d3-a456-426614174000"
]
}
}
Last updated