v1

latestOpenAPI 3.1.02026-07-24403468.9 KB

Create a document from text

This api is based on an existing Knowledge and creates a new document through text based on this Knowledge.

post/datasets/{dataset_id}/document/create_by_text

Path parameters

dataset_idstring required

Knowledge ID

Request body

namestring required

Document name

textstring required

Document content

indexing_techniquestring
  1. "high_quality": embedding using embedding model, built as vector database index. 2. "economy": Build using inverted index of Keyword Table Index

Response

200

batchstring

Example response

{
  "document": {
    "position": 1,
    "data_source_type": "upload_file",
    "name": "text.txt",
    "created_from": "api",
    "created_at": 1695690280,
    "indexing_status": "waiting",
    "enabled": true,
    "display_status": "queuing",
    "doc_form": "text_model"
  }
}