Skip to content

Ingest text

POST
/api/v1/documents/text
curl --request POST \
--url http://localhost:11044/api/v1/documents/text \
--header 'Content-Type: application/json' \
--header 'X-Embabel-Api-Key: <X-Embabel-Api-Key>' \
--data '{ "content": "example", "name": "example", "tags": [ "example" ] }'

Create a document from inline text content, saved to the world’s data/documents directory under the given name; an existing file of that name is overwritten.

Inline text to keep and ingest. content is saved as data/documents/<name> in the world, overwriting any file of that name, then ingested from there; name doubles as the title when none can be parsed from the content. tags are trimmed, blanks dropped and duplicates collapsed; omitted or empty leaves the document untagged

Media typeapplication/json

Body of POST /documents/text: inline text saved as a file in the world’s data/documents directory and ingested from there.

object
content
required

The text to ingest, written to the file as given

string
name
required

File name to save the text under in the world’s data/documents directory, overwriting a file of that name; also the title when the text yields none

string
tags

Tags to put on the document and its chunks. Blanks are dropped and duplicates collapsed; absent means none

Array<string>

Example generated

{
"content": "example",
"name": "example",
"tags": [
"example"
]
}

Document ingested. status is ingested, or ingested_incomplete when some chunks could not be embedded: the document is kept and text-searchable, chunksWithoutEmbeddings of chunks miss semantic search

Media type*/*

A document ingested. Kept and text-searchable even when some chunks could not be embedded

object
chunks

How many chunks were stored, null where the stored record could not be read back

integer format: int32
chunksWithoutEmbeddings
required

How many chunks have no embedding. Zero when every chunk was embedded

integer format: int32
message

Present only for ingested_incomplete: how many chunks miss embeddings, and that re-ingesting embeds them

string
status
required

ingested, or ingested_incomplete when some chunks could not be embedded

string
Allowed values: ingested ingested_incomplete
title

The document’s title. For inline text, the given name where no title was found

string
uri
required

The document’s URI

string

No embedding model is set, so nothing could be searched: the reason names the command that sets one

Media type*/*

An ingest refused because this appliance has no embedding model yet. Not set up, rather than broken

object
embeddings
required

The embedding status this was decided from: configured, model, dimensions and reason

object
key
additional properties
any
message
required

Why, in the operator’s words, naming the command that sets a model

string
status
required

Always unavailable

string

Example

unavailable

Ingestion failed

Media type*/*

An ingest that failed: the word error and the reason

object
message
required

What failed — the fetch or the conversion — in the failure’s own words

string
status
required

Always error

string

Example

error