Documents

Manage documents and their chunks, including creation via URL or file upload, retrieval, update, deletion, search, and status control. Documents can be associated with datasets.

Create A Document

post
查询参数
datasetIdsstring可选Example: ["xxxx"]
tenantUnitIdstring可选Example: 78c8e44c-9ef2-461d-88ba-ee7783a90251
tenantIdstring必填Example: {{tenantId}}
头参数
X-Api-Keystring可选

the API Key

Example: {{apiKey}}
请求体
idstring可选
tenantIdstring必填
tenantUnitIdstring必填
documentTypestring · enum必填可能的值:
documentSubTypestring · enum可选可能的值:
documentNamestring可选
storageTypestring可选

s3, gcs

storageBucketstring可选

use url or storageBucket + storagePath

storagePathstring可选
urlstring可选

use url or storageBucket + storagePath

titlestring可选
customPropertiesobject可选
enabledboolean可选
documentContentstring可选
响应
chevron-right
200成功
application/json
post
/admin/api/v1/documents
200成功

Create a Document by Uploading a File

post
查询参数
tenantIdstring可选Example: {{currentTenantId}}
tenantUnitIdstring可选Example: {{tenantUnitId}}
头参数
X-Api-Keystring可选

the API Key

Example: {{apiKey}}
请求体
documentTypestring必填Example: UnstructuredFile
documentSubTypestring可选Example: pdf
categorystring可选
datasetIdsarray必填Example: ["[\"{{datasetId}}\"]"]
tenantUnitIdstring必填Example: {{tenantUnitId}}
filestring · binary必填Example: file://D:\study\Code\codeRepos\ecompilot-web\tests\synthetic_tests\WoolworthsAnnualReport.pdf
tenantIdstring必填Example: {{tenantId}}
customPropertiesstring可选Example: {"test":true}
响应
chevron-right
200成功
application/json
post
/admin/api/v1/documents/upload
200成功

Upsert a document by external ID

put
路径参数
externalIdstring必填

External ID of the document

查询参数
datasetIdsstring可选

Optional list of dataset IDs as JSON string

Example: ["your-dataset-id"]
tenantIdstring必填Example: {{tenantId}}
头参数
X-Api-Keystring可选

the API Key

Example: {{apiKey}}
请求体
externalIdstring必填

External ID used to identify the document

documentNamestring可选

Name of the document

tenantIdstring必填

Tenant ID

tenantUnitIdstring必填

Tenant Unit ID

urlstring · uri可选

URL of the document to fetch and process

documentContentstring可选

Direct content of the document, if provided

响应
chevron-right
200

Document successfully upserted

application/json
put
/admin/api/v1/api/v1/documents/byExternalId/{externalId}

Get a Document

get
路径参数
documentIdstring必填Example: 2549d630-81ab-41b9-a691-5377fe140fed
查询参数
tenantIdstring必填Example: {{tenantId}}
头参数
X-Api-Keystring可选

the API Key

Example: {{apiKey}}
响应
chevron-right
200成功
application/json
get
/admin/api/v1/documents/{documentId}
200成功

List Documents

get
查询参数
typestring可选Example: UnstructuredFile
tenantUnitIdstring可选Example: {{tenantUnitId}}
datasetIdsstring可选

dataset ids, seperate with comma

Example: xxx,yyy,zzz
typesstring可选

UnstructuredFile StructuredFile UnstructuredWebpage StructuredWebpage

Example: UnstructuredFile
pageinteger可选

default to 1 if not passing this query

Example: 1
pageSizeinteger可选

default to 10 if not passing this query

Example: 10
tenantIdstring必填Example: {{tenantId}}
头参数
X-Api-Keystring可选

the API Key

Example: {{apiKey}}
响应
chevron-right
200成功
application/json
get
/admin/api/v1/documents
200成功

Delete a Document

delete
路径参数
documentIdstring必填
查询参数
tenantIdstring必填Example: {{tenantId}}
头参数
X-Api-Keystring可选

the API Key

Example: {{apiKey}}
响应
delete
/admin/api/v1/documents/{documentId}
204成功

无内容

Get Documents By Ids

get
查询参数
documentIdsstring可选Example: ["xxxx","yyyy"]
tenantIdstring必填Example: {{tenantId}}
头参数
X-Api-Keystring可选

the API Key

Example: {{apiKey}}
响应
chevron-right
200成功
application/json
get
/admin/api/v1/documents/byIds
200成功

Partial update document

patch
路径参数
documentIdstring必填
查询参数
tenantIdstring必填Example: {{tenantId}}
头参数
X-Api-Keystring可选

the API Key

Example: {{apiKey}}
请求体
urlstring可选

use url or storageBucket + storagePath

customPropertiesobject可选
enabledboolean可选
documentContentstring可选
响应
chevron-right
200成功
application/json
patch
/admin/api/v1/documents/{documentId}
200成功

Toggle Document(Enable/Disable)

patch
路径参数
documentIdstring必填
查询参数
tenantIdstring必填Example: {{tenantId}}
头参数
X-Api-Keystring可选

the API Key

Example: {{apiKey}}
请求体
enabledboolean可选
响应
chevron-right
200成功
application/json
响应object
patch
/admin/api/v1/documents/{documentId}/toggle
200成功

List Document Chunks

get
路径参数
documentIdstring必填
查询参数
pageinteger可选

default to 1 if not passing this query

Example: 1
pageSizeinteger可选

default to 10 if not passing this query

Example: 10
tenantIdstring必填Example: {{tenantId}}
头参数
X-Api-Keystring可选

the API Key

Example: {{apiKey}}
响应
chevron-right
200成功
application/json
get
/admin/api/v1/api/v1/documents/{documentId}/documentChunks/
200成功

Document Chunks Search

post
查询参数
tenantIdstring必填Example: {{tenantId}}
头参数
X-Api-Keystring可选

the API Key

Example: {{apiKey}}
请求体
tenant_idstring必填
tenant_unit_idstring必填
dataset_idsstring[]必填
querystring必填
top_kinteger可选

default is 5

languagestring可选

currently support 'english' or 'chinese' , default is 'english'

响应
chevron-right
200成功
application/json
post
/admin/api/v1/api/v1/documentChunks/search
200成功

Patch Document Chunks

patch
路径参数
document_idstring必填
查询参数
tenantIdstring必填Example: {{tenantId}}
头参数
X-Api-Keystring可选

the API Key

Example: {{apiKey}}
请求体
contentstring可选
keywordsstring[]可选
响应
chevron-right
200成功
application/json
响应object
patch
/admin/api/v1/api/v1/documents/{document_id}/documentChunks/<chunk_id>
200成功

Batch Delete Document Chunks

delete
路径参数
document_idstring必填
查询参数
tenantUnitIdstring[]可选Example: [""]
tenantIdstring可选
头参数
X-Api-Keystring可选

the API Key

Example: {{apiKey}}
请求体
object可选
响应
chevron-right
200成功
application/json
响应object
delete
/admin/api/v1/documents/{document_id}/documentChunks/batch
200成功

Batch Change Document Chunks Status

patch
路径参数
document_idstring必填
查询参数
tenantUnitIdstring必填Example: 8313c091-eb49-4d42-91cb-0a1f965a4e90
tenantIdstring可选Example: 07284edf-f254-4503-8ca6-c2deff022fd4
头参数
X-Api-Keystring可选

the API Key

Example: {{apiKey}}
请求体
statusstring必填

active or inactive

documentChunkIdsstring[]必填
响应
chevron-right
200成功
application/json
响应object
patch
/admin/api/v1/documents/{document_id}/documentChunks/batch/status
200成功

Change Document Chunks Status

patch
路径参数
document_idstring必填
查询参数
tenantUnitIdstring必填
tenantIdstring必填Example: {{tenantId}}
头参数
X-Api-Keystring可选

the API Key

Example: {{apiKey}}
请求体
statusstring必填

active or inactive

响应
chevron-right
200成功
application/json
响应object
patch
/admin/api/v1/api/v1/documents/{document_id}/documentChunks/<chunk_id>/status
200成功

最后更新于

这有帮助吗?