Ingestion

Ingest Text

POST

Ingests and processes a text, storing its chunks to be used as context.

The context obtained from files is later used in /chat/completions, /completions, and /chunks APIs.

A Document will be generated with the given text. The Document ID is returned in the response, together with the extracted Metadata (which is later used to improve context retrieval). That ID can be used to filter the context used to create responses in /chat/completions, /completions, and /chunks APIs.

Request

This endpoint expects an object.
file_name
stringRequired
text
stringRequired

Response

This endpoint returns an object
object
any
model
any
data
list of objects
POST
1curl -X POST /v1/ingest/text \
2 -H "Content-Type: application/json" \
3 -d '{
4 "file_name": "file_name",
5 "text": "text"
6}'
200
Successful
1{
2 "object": {
3 "key": "value"
4 },
5 "model": {
6 "key": "value"
7 },
8 "data": [
9 {
10 "object": {
11 "key": "value"
12 },
13 "doc_id": "doc_id"
14 }
15 ]
16}