@ -20,17 +20,17 @@ import { Row, Col, Properties, Property, Heading, SubProperty, Paragraph } from
</CodeGroup>
</CodeGroup>
</div>
</div>
---
<hr className='ml-0 mr-0' />
<Heading
<Heading
url='/datasets/{dataset_id}/document/create_by_ text'
url='/datasets/{dataset_id}/document/create-by- text'
method='POST'
method='POST'
title='Create a document from t ext'
title='Create a Document from T ext'
name='#create_by_ text'
name='#create-by- text'
/>
/>
<Row>
<Row>
<Col>
<Col>
This api is based on an existing Knowledge and creates a new document through text based on this K nowledge.
This API is based on an existing knowledge and creates a new document through text based on this k nowledge.
### Params
### Params
<Properties>
<Properties>
@ -50,7 +50,7 @@ import { Row, Col, Properties, Property, Heading, SubProperty, Paragraph } from
<Property name='indexing_technique' type='string' key='indexing_technique'>
<Property name='indexing_technique' type='string' key='indexing_technique'>
Index mode
Index mode
- <code>high_quality</code> High quality: embedding using embedding model, built as vector database index
- <code>high_quality</code> High quality: embedding using embedding model, built as vector database index
- <code>economy</code> Economy: Build using inverted index of Keyword Table I ndex
- <code>economy</code> Economy: Build using inverted index of keyword table i ndex
</Property>
</Property>
<Property name='process_rule' type='object' key='process_rule'>
<Property name='process_rule' type='object' key='process_rule'>
Processing rules
Processing rules
@ -62,7 +62,7 @@ import { Row, Col, Properties, Property, Heading, SubProperty, Paragraph } from
- <code>remove_extra_spaces</code> Replace consecutive spaces, newlines, tabs
- <code>remove_extra_spaces</code> Replace consecutive spaces, newlines, tabs
- <code>remove_urls_emails</code> Delete URL, email address
- <code>remove_urls_emails</code> Delete URL, email address
- <code>enabled</code> (bool) Whether to select this rule or not. If no document ID is passed in, it represents the default value.
- <code>enabled</code> (bool) Whether to select this rule or not. If no document ID is passed in, it represents the default value.
- <code>segmentation</code> (object) s egmentation rules
- <code>segmentation</code> (object) S egmentation rules
- <code>separator</code> Custom segment identifier, currently only allows one delimiter to be set. Default is \n
- <code>separator</code> Custom segment identifier, currently only allows one delimiter to be set. Default is \n
- <code>max_tokens</code> Maximum length (token) defaults to 1000
- <code>max_tokens</code> Maximum length (token) defaults to 1000
</Property>
</Property>
@ -72,11 +72,11 @@ import { Row, Col, Properties, Property, Heading, SubProperty, Paragraph } from
<CodeGroup
<CodeGroup
title="Request"
title="Request"
tag="POST"
tag="POST"
label="/datasets/{dataset_id}/document/create_by_ text"
label="/datasets/{dataset_id}/document/create-by- text"
targetCode={`curl --location --request POST '${props.apiBaseUrl}/datasets/{dataset_id}/document/create_by_ text' \\\n--header 'Authorization: Bearer {api_key}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{"name": "text","text": "text","indexing_technique": "high_quality","process_rule": {"mode": "automatic"}}'`}
targetCode={`curl --location --request POST '${props.apiBaseUrl}/datasets/{dataset_id}/document/create-by- text' \\\n--header 'Authorization: Bearer {api_key}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{"name": "text","text": "text","indexing_technique": "high_quality","process_rule": {"mode": "automatic"}}'`}
>
>
```bash {{ title: 'cURL' }}
```bash {{ title: 'cURL' }}
curl --location --request POST '${props.apiBaseUrl}/datasets/{dataset_id}/document/create_by_ text' \
curl --location --request POST '${props.apiBaseUrl}/datasets/{dataset_id}/document/create-by- text' \
--header 'Authorization: Bearer {api_key}' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: application/json' \
--header 'Content-Type: application/json' \
--data-raw '{
--data-raw '{
@ -123,17 +123,17 @@ import { Row, Col, Properties, Property, Heading, SubProperty, Paragraph } from
</Col>
</Col>
</Row>
</Row>
---
<hr className='ml-0 mr-0' />
<Heading
<Heading
url='/datasets/{dataset_id}/document/create_by_ file'
url='/datasets/{dataset_id}/document/create-by- file'
method='POST'
method='POST'
title='Create documents from files '
title='Create a Document from a File '
name='#create_by_ file'
name='#create-by- file'
/>
/>
<Row>
<Row>
<Col>
<Col>
This api is based on an existing Knowledge and creates a new document through a file based on this K nowledge.
This API is based on an existing knowledge and creates a new document through a file based on this k nowledge.
### Params
### Params
<Properties>
<Properties>
@ -145,17 +145,17 @@ import { Row, Col, Properties, Property, Heading, SubProperty, Paragraph } from
### Request Body
### Request Body
<Properties>
<Properties>
<Property name='data' type='multipart/form-data json string' key='data'>
<Property name='data' type='multipart/form-data json string' key='data'>
- original_document_id Source document ID (optional)
- <code> original_document_id</code> Source document ID (optional)
- Used to re-upload the document or modify the document cleaning and segmentation configuration. The missing information is copied from the source document
- Used to re-upload the document or modify the document cleaning and segmentation configuration. The missing information is copied from the source document
- The source document cannot be an archived document
- The source document cannot be an archived document
- When original_document_id is passed in, the update operation is performed on behalf of the document. process_rule is a fillable item. If not filled in, the segmentation method of the source document will be used by default
- When original_document_id is passed in, the update operation is performed on behalf of the document. process_rule is a fillable item. If not filled in, the segmentation method of the source document will be used by default
- When original_document_id is not passed in, the new operation is performed on behalf of the document, and process_rule is required
- When original_document_id is not passed in, the new operation is performed on behalf of the document, and process_rule is required
- indexing_technique Index mode
- <code> indexing_technique</code> Index mode
- <code>high_quality</code> High quality: embedding using embedding model, built as vector database index
- <code>high_quality</code> High quality: embedding using embedding model, built as vector database index
- <code>economy</code> Economy: Build using inverted index of Keyword Table I ndex
- <code>economy</code> Economy: Build using inverted index of keyword table i ndex
- process_rule Processing rules
- <code> process_rule</code> Processing rules
- <code>mode</code> (string) Cleaning, segmentation mode, automatic / custom
- <code>mode</code> (string) Cleaning, segmentation mode, automatic / custom
- <code>rules</code> (object) Custom rules (in automatic mode, this field is empty)
- <code>rules</code> (object) Custom rules (in automatic mode, this field is empty)
- <code>pre_processing_rules</code> (array[object]) Preprocessing rules
- <code>pre_processing_rules</code> (array[object]) Preprocessing rules
@ -164,7 +164,7 @@ import { Row, Col, Properties, Property, Heading, SubProperty, Paragraph } from
- <code>remove_extra_spaces</code> Replace consecutive spaces, newlines, tabs
- <code>remove_extra_spaces</code> Replace consecutive spaces, newlines, tabs
- <code>remove_urls_emails</code> Delete URL, email address
- <code>remove_urls_emails</code> Delete URL, email address
- <code>enabled</code> (bool) Whether to select this rule or not. If no document ID is passed in, it represents the default value.
- <code>enabled</code> (bool) Whether to select this rule or not. If no document ID is passed in, it represents the default value.
- <code>segmentation</code> (object) s egmentation rules
- <code>segmentation</code> (object) S egmentation rules
- <code>separator</code> Custom segment identifier, currently only allows one delimiter to be set. Default is \n
- <code>separator</code> Custom segment identifier, currently only allows one delimiter to be set. Default is \n
- <code>max_tokens</code> Maximum length (token) defaults to 1000
- <code>max_tokens</code> Maximum length (token) defaults to 1000
</Property>
</Property>
@ -177,11 +177,11 @@ import { Row, Col, Properties, Property, Heading, SubProperty, Paragraph } from
<CodeGroup
<CodeGroup
title="Request"
title="Request"
tag="POST"
tag="POST"
label="/datasets/{dataset_id}/document/create_by_ file"
label="/datasets/{dataset_id}/document/create-by- file"
targetCode={`curl --location --request POST '${props.apiBaseUrl}/datasets/{dataset_id}/document/create_by_ file' \\\n--header 'Authorization: Bearer {api_key}' \\\n--form 'data="{"indexing_technique":"high_quality","process_rule":{"rules":{"pre_processing_rules":[{"id":"remove_extra_spaces","enabled":true},{"id":"remove_urls_emails","enabled":true}],"segmentation":{"separator":"###","max_tokens":500}},"mode":"custom"}}";type=text/plain' \\\n--form 'file=@"/path/to/file"'`}
targetCode={`curl --location --request POST '${props.apiBaseUrl}/datasets/{dataset_id}/document/create-by- file' \\\n--header 'Authorization: Bearer {api_key}' \\\n--form 'data="{"indexing_technique":"high_quality","process_rule":{"rules":{"pre_processing_rules":[{"id":"remove_extra_spaces","enabled":true},{"id":"remove_urls_emails","enabled":true}],"segmentation":{"separator":"###","max_tokens":500}},"mode":"custom"}}";type=text/plain' \\\n--form 'file=@"/path/to/file"'`}
>
>
```bash {{ title: 'cURL' }}
```bash {{ title: 'cURL' }}
curl --location --request POST '${props.apiBaseUrl}/datasets/{dataset_id}/document/create_by_ file' \
curl --location --request POST '${props.apiBaseUrl}/datasets/{dataset_id}/document/create-by- file' \
--header 'Authorization: Bearer {api_key}' \
--header 'Authorization: Bearer {api_key}' \
--form 'data="{\"name\":\"Dify\",\"indexing_technique\":\"high_quality\",\"process_rule\":{\"rules\":{\"pre_processing_rules\":[{\"id\":\"remove_extra_spaces\",\"enabled\":true},{\"id\":\"remove_urls_emails\",\"enabled\":true}],\"segmentation\":{\"separator\":\"###\",\"max_tokens\":500}},\"mode\":\"custom\"}}";type=text/plain' \
--form 'data="{\"name\":\"Dify\",\"indexing_technique\":\"high_quality\",\"process_rule\":{\"rules\":{\"pre_processing_rules\":[{\"id\":\"remove_extra_spaces\",\"enabled\":true},{\"id\":\"remove_urls_emails\",\"enabled\":true}],\"segmentation\":{\"separator\":\"###\",\"max_tokens\":500}},\"mode\":\"custom\"}}";type=text/plain' \
--form 'file=@"/path/to/file"'
--form 'file=@"/path/to/file"'
@ -221,12 +221,12 @@ import { Row, Col, Properties, Property, Heading, SubProperty, Paragraph } from
</Col>
</Col>
</Row>
</Row>
---
<hr className='ml-0 mr-0' />
<Heading
<Heading
url='/datasets'
url='/datasets'
method='POST'
method='POST'
title='Create an empty Knowledg e'
title='Create an Empty Knowledge Bas e'
name='#create_empty_dataset'
name='#create_empty_dataset'
/>
/>
<Row>
<Row>
@ -240,9 +240,9 @@ import { Row, Col, Properties, Property, Heading, SubProperty, Paragraph } from
Knowledge description (optional)
Knowledge description (optional)
</Property>
</Property>
<Property name='indexing_technique' type='string' key='indexing_technique'>
<Property name='indexing_technique' type='string' key='indexing_technique'>
Index T echnique (optional)
Index t echnique (optional)
- <code>high_quality</code> high_ quality
- <code>high_quality</code> High quality
- <code>economy</code> e conomy
- <code>economy</code> E conomy
</Property>
</Property>
<Property name='permission' type='string' key='permission'>
<Property name='permission' type='string' key='permission'>
Permission
Permission
@ -252,21 +252,21 @@ import { Row, Col, Properties, Property, Heading, SubProperty, Paragraph } from
</Property>
</Property>
<Property name='provider' type='string' key='provider'>
<Property name='provider' type='string' key='provider'>
Provider (optional, default: vendor)
Provider (optional, default: vendor)
- <code>vendor</code> v endor
- <code>vendor</code> V endor
- <code>external</code> e xternal knowledge
- <code>external</code> E xternal knowledge
</Property>
</Property>
<Property name='external_knowledge_api_id' type='str' key='external_knowledge_api_id'>
<Property name='external_knowledge_api_id' type='str' key='external_knowledge_api_id'>
External Knowledge api id (optional)
External knowledge API ID (optional)
</Property>
</Property>
<Property name='external_knowledge_id' type='str' key='external_knowledge_id'>
<Property name='external_knowledge_id' type='str' key='external_knowledge_id'>
External Knowledge id (optional)
External knowledge ID (optional)
</Property>
</Property>
</Properties>
</Properties>
</Col>
</Col>
<Col sticky>
<Col sticky>
<CodeGroup
<CodeGroup
title="Request"
title="Request"
tag="POST"
tag="POST"
label="/datasets"
label="/datasets"
targetCode={`curl --location --request POST '${props.apiBaseUrl}/datasets' \\\n--header 'Authorization: Bearer {api_key}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{"name": "name", "permission": "only_me"}'`}
targetCode={`curl --location --request POST '${props.apiBaseUrl}/datasets' \\\n--header 'Authorization: Bearer {api_key}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{"name": "name", "permission": "only_me"}'`}
>
>
@ -306,12 +306,12 @@ import { Row, Col, Properties, Property, Heading, SubProperty, Paragraph } from
</Col>
</Col>
</Row>
</Row>
---
<hr className='ml-0 mr-0' />
<Heading
<Heading
url='/datasets'
url='/datasets'
method='GET'
method='GET'
title='Knowledge l ist'
title='Get Knowledge Base L ist'
name='#dataset_list'
name='#dataset_list'
/>
/>
<Row>
<Row>
@ -327,9 +327,9 @@ import { Row, Col, Properties, Property, Heading, SubProperty, Paragraph } from
</Properties>
</Properties>
</Col>
</Col>
<Col sticky>
<Col sticky>
<CodeGroup
<CodeGroup
title="Request"
title="Request"
tag="POST"
tag="POST"
label="/datasets"
label="/datasets"
targetCode={`curl --location --request GET '${props.apiBaseUrl}/datasets?page=1&limit=20' \\\n--header 'Authorization: Bearer {api_key}'`}
targetCode={`curl --location --request GET '${props.apiBaseUrl}/datasets?page=1&limit=20' \\\n--header 'Authorization: Bearer {api_key}'`}
>
>
@ -369,12 +369,12 @@ import { Row, Col, Properties, Property, Heading, SubProperty, Paragraph } from
</Col>
</Col>
</Row>
</Row>
---
<hr className='ml-0 mr-0' />
<Heading
<Heading
url='/datasets/{dataset_id}'
url='/datasets/{dataset_id}'
method='DELETE'
method='DELETE'
title='Delete knowledg e'
title='Delete a Knowledge Bas e'
name='#delete_dataset'
name='#delete_dataset'
/>
/>
<Row>
<Row>
@ -406,17 +406,17 @@ import { Row, Col, Properties, Property, Heading, SubProperty, Paragraph } from
</Col>
</Col>
</Row>
</Row>
---
<hr className='ml-0 mr-0' />
<Heading
<Heading
url='/datasets/{dataset_id}/documents/{document_id}/update_by_ text'
url='/datasets/{dataset_id}/documents/{document_id}/update-by- text'
method='POST'
method='POST'
title='Update document via t ext'
title='Update a Document with T ext'
name='#update_by_ text'
name='#update-by- text'
/>
/>
<Row>
<Row>
<Col>
<Col>
This api is based on an existing Knowledge and updates the document through text based on this K nowledge.
This API is based on an existing knowledge and updates the document through text based on this k nowledge.
### Params
### Params
<Properties>
<Properties>
@ -446,7 +446,7 @@ import { Row, Col, Properties, Property, Heading, SubProperty, Paragraph } from
- <code>remove_extra_spaces</code> Replace consecutive spaces, newlines, tabs
- <code>remove_extra_spaces</code> Replace consecutive spaces, newlines, tabs
- <code>remove_urls_emails</code> Delete URL, email address
- <code>remove_urls_emails</code> Delete URL, email address
- <code>enabled</code> (bool) Whether to select this rule or not. If no document ID is passed in, it represents the default value.
- <code>enabled</code> (bool) Whether to select this rule or not. If no document ID is passed in, it represents the default value.
- <code>segmentation</code> (object) s egmentation rules
- <code>segmentation</code> (object) S egmentation rules
- <code>separator</code> Custom segment identifier, currently only allows one delimiter to be set. Default is \n
- <code>separator</code> Custom segment identifier, currently only allows one delimiter to be set. Default is \n
- <code>max_tokens</code> Maximum length (token) defaults to 1000
- <code>max_tokens</code> Maximum length (token) defaults to 1000
</Property>
</Property>
@ -456,11 +456,11 @@ import { Row, Col, Properties, Property, Heading, SubProperty, Paragraph } from
<CodeGroup
<CodeGroup
title="Request"
title="Request"
tag="POST"
tag="POST"
label="/datasets/{dataset_id}/documents/{document_id}/update_by_ text"
label="/datasets/{dataset_id}/documents/{document_id}/update-by- text"
targetCode={`curl --location --request POST '${props.apiBaseUrl}/datasets/{dataset_id}/documents/{document_id}/update_by_ text' \\\n--header 'Authorization: Bearer {api_key}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{"name": "name","text": "text"}'`}
targetCode={`curl --location --request POST '${props.apiBaseUrl}/datasets/{dataset_id}/documents/{document_id}/update-by- text' \\\n--header 'Authorization: Bearer {api_key}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{"name": "name","text": "text"}'`}
>
>
```bash {{ title: 'cURL' }}
```bash {{ title: 'cURL' }}
curl --location --request POST '${props.apiBaseUrl}/datasets/{dataset_id}/documents/{document_id}/update_by_ text' \
curl --location --request POST '${props.apiBaseUrl}/datasets/{dataset_id}/documents/{document_id}/update-by- text' \
--header 'Authorization: Bearer {api_key}' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: application/json' \
--header 'Content-Type: application/json' \
--data-raw '{
--data-raw '{
@ -503,17 +503,17 @@ import { Row, Col, Properties, Property, Heading, SubProperty, Paragraph } from
</Col>
</Col>
</Row>
</Row>
---
<hr className='ml-0 mr-0' />
<Heading
<Heading
url='/datasets/{dataset_id}/documents/{document_id}/update_by_ file'
url='/datasets/{dataset_id}/documents/{document_id}/update-by- file'
method='POST'
method='POST'
title='Update a document from a f ile'
title='Update a Document with a F ile'
name='#update_by_ file'
name='#update-by- file'
/>
/>
<Row>
<Row>
<Col>
<Col>
This api is based on an existing Knowledge, and updates documents through files based on this K nowledge
This API is based on an existing knowledge, and updates documents through files based on this k nowledge
### Params
### Params
<Properties>
<Properties>
@ -543,7 +543,7 @@ import { Row, Col, Properties, Property, Heading, SubProperty, Paragraph } from
- <code>remove_extra_spaces</code> Replace consecutive spaces, newlines, tabs
- <code>remove_extra_spaces</code> Replace consecutive spaces, newlines, tabs
- <code>remove_urls_emails</code> Delete URL, email address
- <code>remove_urls_emails</code> Delete URL, email address
- <code>enabled</code> (bool) Whether to select this rule or not. If no document ID is passed in, it represents the default value.
- <code>enabled</code> (bool) Whether to select this rule or not. If no document ID is passed in, it represents the default value.
- <code>segmentation</code> (object) s egmentation rules
- <code>segmentation</code> (object) S egmentation rules
- <code>separator</code> Custom segment identifier, currently only allows one delimiter to be set. Default is \n
- <code>separator</code> Custom segment identifier, currently only allows one delimiter to be set. Default is \n
- <code>max_tokens</code> Maximum length (token) defaults to 1000
- <code>max_tokens</code> Maximum length (token) defaults to 1000
</Property>
</Property>
@ -553,11 +553,11 @@ import { Row, Col, Properties, Property, Heading, SubProperty, Paragraph } from
<CodeGroup
<CodeGroup
title="Request"
title="Request"
tag="POST"
tag="POST"
label="/datasets/{dataset_id}/documents/{document_id}/update_by_ file"
label="/datasets/{dataset_id}/documents/{document_id}/update-by- file"
targetCode={`curl --location --request POST '${props.apiBaseUrl}/datasets/{dataset_id}/documents/{document_id}/update_by_ file' \\\n--header 'Authorization: Bearer {api_key}' \\\n--form 'data="{"name":"Dify","indexing_technique":"high_quality","process_rule":{"rules":{"pre_processing_rules":[{"id":"remove_extra_spaces","enabled":true},{"id":"remove_urls_emails","enabled":true}],"segmentation":{"separator":"###","max_tokens":500}},"mode":"custom"}}";type=text/plain' \\\n--form 'file=@"/path/to/file"'`}
targetCode={`curl --location --request POST '${props.apiBaseUrl}/datasets/{dataset_id}/documents/{document_id}/update-by- file' \\\n--header 'Authorization: Bearer {api_key}' \\\n--form 'data="{"name":"Dify","indexing_technique":"high_quality","process_rule":{"rules":{"pre_processing_rules":[{"id":"remove_extra_spaces","enabled":true},{"id":"remove_urls_emails","enabled":true}],"segmentation":{"separator":"###","max_tokens":500}},"mode":"custom"}}";type=text/plain' \\\n--form 'file=@"/path/to/file"'`}
>
>
```bash {{ title: 'cURL' }}
```bash {{ title: 'cURL' }}
curl --location --request POST '${props.apiBaseUrl}/datasets/{dataset_id}/documents/{document_id}/update_by_ file' \
curl --location --request POST '${props.apiBaseUrl}/datasets/{dataset_id}/documents/{document_id}/update-by- file' \
--header 'Authorization: Bearer {api_key}' \
--header 'Authorization: Bearer {api_key}' \
--form 'data="{\"name\":\"Dify\",\"indexing_technique\":\"high_quality\",\"process_rule\":{\"rules\":{\"pre_processing_rules\":[{\"id\":\"remove_extra_spaces\",\"enabled\":true},{\"id\":\"remove_urls_emails\",\"enabled\":true}],\"segmentation\":{\"separator\":\"###\",\"max_tokens\":500}},\"mode\":\"custom\"}}";type=text/plain' \
--form 'data="{\"name\":\"Dify\",\"indexing_technique\":\"high_quality\",\"process_rule\":{\"rules\":{\"pre_processing_rules\":[{\"id\":\"remove_extra_spaces\",\"enabled\":true},{\"id\":\"remove_urls_emails\",\"enabled\":true}],\"segmentation\":{\"separator\":\"###\",\"max_tokens\":500}},\"mode\":\"custom\"}}";type=text/plain' \
--form 'file=@"/path/to/file"'
--form 'file=@"/path/to/file"'
@ -597,12 +597,12 @@ import { Row, Col, Properties, Property, Heading, SubProperty, Paragraph } from
</Col>
</Col>
</Row>
</Row>
---
<hr className='ml-0 mr-0' />
<Heading
<Heading
url='/datasets/{dataset_id}/documents/{batch}/indexing-status'
url='/datasets/{dataset_id}/documents/{batch}/indexing-status'
method='GET'
method='GET'
title='Get document embedding status (p rogress)'
title='Get Document Embedding Status (P rogress)'
name='#indexing_status'
name='#indexing_status'
/>
/>
<Row>
<Row>
@ -652,12 +652,12 @@ import { Row, Col, Properties, Property, Heading, SubProperty, Paragraph } from
</Col>
</Col>
</Row>
</Row>
---
<hr className='ml-0 mr-0' />
<Heading
<Heading
url='/datasets/{dataset_id}/documents/{document_id}'
url='/datasets/{dataset_id}/documents/{document_id}'
method='DELETE'
method='DELETE'
title='Delete d ocument'
title='Delete a D ocument'
name='#delete_document'
name='#delete_document'
/>
/>
<Row>
<Row>
@ -694,12 +694,12 @@ import { Row, Col, Properties, Property, Heading, SubProperty, Paragraph } from
</Col>
</Col>
</Row>
</Row>
---
<hr className='ml-0 mr-0' />
<Heading
<Heading
url='/datasets/{dataset_id}/documents'
url='/datasets/{dataset_id}/documents'
method='GET'
method='GET'
title='Knowledge document list '
title='Get the Document List of a Knowledge Base '
name='#dataset_document_list'
name='#dataset_document_list'
/>
/>
<Row>
<Row>
@ -714,13 +714,13 @@ import { Row, Col, Properties, Property, Heading, SubProperty, Paragraph } from
### Query
### Query
<Properties>
<Properties>
<Property name='keyword' type='string' key='keyword'>
<Property name='keyword' type='string' key='keyword'>
Search keywords, currently only search document names(optional)
Search keywords, currently only search document names (optional)
</Property>
</Property>
<Property name='page' type='string' key='page'>
<Property name='page' type='string' key='page'>
Page number(optional)
Page number (optional)
</Property>
</Property>
<Property name='limit' type='string' key='limit'>
<Property name='limit' type='string' key='limit'>
Number of items returned, default 20, range 1-100(optional)
Number of items returned, default 20, range 1-100 (optional)
</Property>
</Property>
</Properties>
</Properties>
</Col>
</Col>
@ -769,12 +769,12 @@ import { Row, Col, Properties, Property, Heading, SubProperty, Paragraph } from
</Col>
</Col>
</Row>
</Row>
---
<hr className='ml-0 mr-0' />
<Heading
<Heading
url='/datasets/{dataset_id}/documents/{document_id}/segments'
url='/datasets/{dataset_id}/documents/{document_id}/segments'
method='POST'
method='POST'
title='Add seg ment'
title='Add Chunks to a Docu ment'
name='#create_new_segment'
name='#create_new_segment'
/>
/>
<Row>
<Row>
@ -792,9 +792,9 @@ import { Row, Col, Properties, Property, Heading, SubProperty, Paragraph } from
### Request Body
### Request Body
<Properties>
<Properties>
<Property name='segments' type='object list' key='segments'>
<Property name='segments' type='object list' key='segments'>
- <code>content</code> (text) Text content/question content, required
- <code>content</code> (text) Text content / question content, required
- <code>answer</code> (text) Answer content, if the mode of the Knowledge is qa mode, pass the value (optional)
- <code>answer</code> (text) Answer content, if the mode of the knowledge is Q&A mode, pass the value (optional)
- <code>keywords</code> (list) Keywords(optional)
- <code>keywords</code> (list) Keywords (optional)
</Property>
</Property>
</Properties>
</Properties>
</Col>
</Col>
@ -855,12 +855,12 @@ import { Row, Col, Properties, Property, Heading, SubProperty, Paragraph } from
</Col>
</Col>
</Row>
</Row>
---
<hr className='ml-0 mr-0' />
<Heading
<Heading
url='/datasets/{dataset_id}/documents/{document_id}/segments'
url='/datasets/{dataset_id}/documents/{document_id}/segments'
method='GET'
method='GET'
title='get documents segments '
title='Get Chunks from a Document '
name='#get_segment'
name='#get_segment'
/>
/>
<Row>
<Row>
@ -878,10 +878,10 @@ import { Row, Col, Properties, Property, Heading, SubProperty, Paragraph } from
### Query
### Query
<Properties>
<Properties>
<Property name='keyword' type='string' key='keyword'>
<Property name='keyword' type='string' key='keyword'>
keyword, choosable
Keyword (optional)
</Property>
</Property>
<Property name='status' type='string' key='status'>
<Property name='status' type='string' key='status'>
Search status, completed
Search status, completed
</Property>
</Property>
</Properties>
</Properties>
</Col>
</Col>
@ -933,12 +933,12 @@ import { Row, Col, Properties, Property, Heading, SubProperty, Paragraph } from
</Col>
</Col>
</Row>
</Row>
---
<hr className='ml-0 mr-0' />
<Heading
<Heading
url='/datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}'
url='/datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}'
method='DELETE'
method='DELETE'
title='delete document seg ment'
title='Delete a Chunk in a Docu ment'
name='#delete_segment'
name='#delete_segment'
/>
/>
<Row>
<Row>
@ -979,12 +979,12 @@ import { Row, Col, Properties, Property, Heading, SubProperty, Paragraph } from
</Col>
</Col>
</Row>
</Row>
---
<hr className='ml-0 mr-0' />
<Heading
<Heading
url='/datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}'
url='/datasets/{dataset_id}/documents/{document_id}/segments/{segment_id}'
method='POST'
method='POST'
title='update document segment '
title='Update a Chunk in a Document '
name='#update_segment'
name='#update_segment'
/>
/>
<Row>
<Row>
@ -1005,10 +1005,10 @@ import { Row, Col, Properties, Property, Heading, SubProperty, Paragraph } from
### Request Body
### Request Body
<Properties>
<Properties>
<Property name='segment' type='object' key='segment'>
<Property name='segment' type='object' key='segment'>
- <code>content</code> (text) text content/question content, required
- <code>content</code> (text) Text content / question content, required
- <code>answer</code> (text) Answer content, not required, passed if the Knowledge is in qa mode
- <code>answer</code> (text) Answer content, passed if the knowledge is in Q&A mode (optional)
- <code>keywords</code> (list) keyword, not required
- <code>keywords</code> (list) Keyword (optional)
- <code>enabled</code> (bool) false/true, not required
- <code>enabled</code> (bool) False / true (optional)
</Property>
</Property>
</Properties>
</Properties>
</Col>
</Col>
@ -1067,41 +1067,41 @@ import { Row, Col, Properties, Property, Heading, SubProperty, Paragraph } from
</Col>
</Col>
</Row>
</Row>
---
<hr className='ml-0 mr-0' />
<Heading
<Heading
url='/datasets/{dataset_id}/hit-testing '
url='/datasets/{dataset_id}/retrieve '
method='POST'
method='POST'
title='Dataset hit testing '
title='Retrieve Chunks from a Knowledge Base '
name='#dataset_hit_testing '
name='#dataset_retrieval '
/>
/>
<Row>
<Row>
<Col>
<Col>
### Path
### Path
<Properties>
<Properties>
<Property name='dataset_id' type='string' key='dataset_id'>
<Property name='dataset_id' type='string' key='dataset_id'>
Dataset ID
Knowledge ID
</Property>
</Property>
</Properties>
</Properties>
### Request Body
### Request Body
<Properties>
<Properties>
<Property name='query' type='string' key='query'>
<Property name='query' type='string' key='query'>
retrieval keywordc
Query keyword
</Property>
</Property>
<Property name='retrieval_model' type='object' key='retrieval_model'>
<Property name='retrieval_model' type='object' key='retrieval_model'>
retrieval keyword(O ptional, if not filled, it will be recalled according to the default method)
Retrieval model (o ptional, if not filled, it will be recalled according to the default method)
- <code>search_method</code> (text) Search method: One of the following four keywords is required
- <code>search_method</code> (text) Search method: One of the following four keywords is required
- <code>keyword_search</code> Keyword search
- <code>keyword_search</code> Keyword search
- <code>semantic_search</code> Semantic search
- <code>semantic_search</code> Semantic search
- <code>full_text_search</code> Full-text search
- <code>full_text_search</code> Full-text search
- <code>hybrid_search</code> Hybrid search
- <code>hybrid_search</code> Hybrid search
- <code>reranking_enable</code> (bool) Whether to enable reranking, optional, required if the search mode is semantic_search or hybrid_search
- <code>reranking_enable</code> (bool) Whether to enable reranking, required if the search mode is semantic_search or hybrid_search (optional)
- <code>reranking_mode</code> (object) Rerank model configuration, optional, required if reranking is enabled
- <code>reranking_mode</code> (object) Rerank model configuration, required if reranking is enabled
- <code>reranking_provider_name</code> (string) Rerank model provider
- <code>reranking_provider_name</code> (string) Rerank model provider
- <code>reranking_model_name</code> (string) Rerank model name
- <code>reranking_model_name</code> (string) Rerank model name
- <code>weights</code> (double) Semantic search weight setting in hybrid search mode
- <code>weights</code> (double) Semantic search weight setting in hybrid search mode
- <code>top_k</code> (integer) Number of results to return, optional
- <code>top_k</code> (integer) Number of results to return ( optional)
- <code>score_threshold_enabled</code> (bool) Whether to enable score threshold
- <code>score_threshold_enabled</code> (bool) Whether to enable score threshold
- <code>score_threshold</code> (double) Score threshold
- <code>score_threshold</code> (double) Score threshold
</Property>
</Property>
@ -1114,26 +1114,26 @@ import { Row, Col, Properties, Property, Heading, SubProperty, Paragraph } from
<CodeGroup
<CodeGroup
title="Request"
title="Request"
tag="POST"
tag="POST"
label="/datasets/{dataset_id}/hit-testing "
label="/datasets/{dataset_id}/retrieve "
targetCode={`curl --location --request GET '${props.apiBaseUrl}/datasets/{dataset_id}/hit-testing ' \\\n--header 'Authorization: Bearer {api_key}'\\\n--header 'Content-Type: application/json'\\\n--data-raw '{
targetCode={`curl --location --request GET '${props.apiBaseUrl}/datasets/{dataset_id}/retrieve ' \\\n--header 'Authorization: Bearer {api_key}'\\\n--header 'Content-Type: application/json'\\\n--data-raw '{
"query": "test",
"query": "test",
"retrieval_model": {
"retrieval_model": {
"search_method": "keyword_search",
"search_method": "keyword_search",
"reranking_enable": false,
"reranking_enable": false,
"reranking_mode": null,
"reranking_mode": null,
"reranking_model": {
"reranking_model": {
"reranking_provider_name": "",
"reranking_provider_name": "",
"reranking_model_name": ""
"reranking_model_name": ""
},
},
"weights": null,
"weights": null,
"top_k": 1,
"top_k": 1,
"score_threshold_enabled": false,
"score_threshold_enabled": false,
"score_threshold": null
"score_threshold": null
}
}
}'`}
}'`}
>
>
```bash {{ title: 'cURL' }}
```bash {{ title: 'cURL' }}
curl --location --request POST '${props.apiBaseUrl}/datasets/{dataset_id}/hit-testing ' \
curl --location --request POST '${props.apiBaseUrl}/datasets/{dataset_id}/retrieve ' \
--header 'Authorization: Bearer {api_key}' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: application/json' \
--header 'Content-Type: application/json' \
--data-raw '{
--data-raw '{
@ -1212,7 +1212,7 @@ import { Row, Col, Properties, Property, Heading, SubProperty, Paragraph } from
</Col>
</Col>
</Row>
</Row>
---
<hr className='ml-0 mr-0' />
<Row>
<Row>
<Col>
<Col>