From a1d20085e659e816e70a2ff7c39e04fbf48292fb Mon Sep 17 00:00:00 2001
From: Chenming C <43266446+chen622@users.noreply.github.com>
Date: Thu, 17 Apr 2025 10:10:27 +0800
Subject: [PATCH] fix: change the method of update_dataset api in document
(#18197)
---
.../datasets/template/template.en.mdx | 69 ++++++++++++++++---
.../datasets/template/template.zh.mdx | 69 ++++++++++++++++---
2 files changed, 122 insertions(+), 16 deletions(-)
diff --git a/web/app/(commonLayout)/datasets/template/template.en.mdx b/web/app/(commonLayout)/datasets/template/template.en.mdx
index 357b66a96f..54e08b45d8 100644
--- a/web/app/(commonLayout)/datasets/template/template.en.mdx
+++ b/web/app/(commonLayout)/datasets/template/template.en.mdx
@@ -557,7 +557,7 @@ import { Row, Col, Properties, Property, Heading, SubProperty, PropertyInstructi
@@ -585,8 +585,21 @@ import { Row, Col, Properties, Property, Heading, SubProperty, PropertyInstructi
Specified embedding model, corresponding to the model field(Optional)
-
- Specified retrieval model, corresponding to the model field(Optional)
+
+ Retrieval model (optional, if not filled, it will be recalled according to the default method)
+ - search_method
(text) Search method: One of the following four keywords is required
+ - keyword_search
Keyword search
+ - semantic_search
Semantic search
+ - full_text_search
Full-text search
+ - hybrid_search
Hybrid search
+ - reranking_enable
(bool) Whether to enable reranking, required if the search mode is semantic_search or hybrid_search (optional)
+ - reranking_mode
(object) Rerank model configuration, required if reranking is enabled
+ - reranking_provider_name
(string) Rerank model provider
+ - reranking_model_name
(string) Rerank model name
+ - weights
(float) Semantic search weight setting in hybrid search mode
+ - top_k
(integer) Number of results to return (optional)
+ - score_threshold_enabled
(bool) Whether to enable score threshold
+ - score_threshold
(float) Score threshold
Partial member list(Optional)
@@ -596,16 +609,56 @@ import { Row, Col, Properties, Property, Heading, SubProperty, PropertyInstructi
```bash {{ title: 'cURL' }}
- curl --location --request POST '${props.apiBaseUrl}/datasets/{dataset_id}' \
+ curl --location --request PATCH '${props.apiBaseUrl}/datasets/{dataset_id}' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: application/json' \
- --data-raw '{"name": "Test Knowledge Base", "indexing_technique": "high_quality", "permission": "only_me",\
- "embedding_model_provider": "zhipuai", "embedding_model": "embedding-3", "retrieval_model": "", "partial_member_list": []}'
+ --data-raw '{
+ "name": "Test Knowledge Base",
+ "indexing_technique": "high_quality",
+ "permission": "only_me",
+ "embedding_model_provider": "zhipuai",
+ "embedding_model": "embedding-3",
+ "retrieval_model": {
+ "search_method": "keyword_search",
+ "reranking_enable": false,
+ "reranking_mode": null,
+ "reranking_model": {
+ "reranking_provider_name": "",
+ "reranking_model_name": ""
+ },
+ "weights": null,
+ "top_k": 1,
+ "score_threshold_enabled": false,
+ "score_threshold": null
+ },
+ "partial_member_list": []
+ }'
```
diff --git a/web/app/(commonLayout)/datasets/template/template.zh.mdx b/web/app/(commonLayout)/datasets/template/template.zh.mdx
index fb8f728b61..b435a9bb67 100644
--- a/web/app/(commonLayout)/datasets/template/template.zh.mdx
+++ b/web/app/(commonLayout)/datasets/template/template.zh.mdx
@@ -557,7 +557,7 @@ import { Row, Col, Properties, Property, Heading, SubProperty, PropertyInstructi
@@ -589,8 +589,21 @@ import { Row, Col, Properties, Property, Heading, SubProperty, PropertyInstructi
嵌入模型(选填)
-
- 检索模型(选填)
+
+ 检索参数(选填,如不填,按照默认方式召回)
+ - search_method
(text) 检索方法:以下三个关键字之一,必填
+ - keyword_search
关键字检索
+ - semantic_search
语义检索
+ - full_text_search
全文检索
+ - hybrid_search
混合检索
+ - reranking_enable
(bool) 是否启用 Reranking,非必填,如果检索模式为 semantic_search 模式或者 hybrid_search 则传值
+ - reranking_mode
(object) Rerank 模型配置,非必填,如果启用了 reranking 则传值
+ - reranking_provider_name
(string) Rerank 模型提供商
+ - reranking_model_name
(string) Rerank 模型名称
+ - weights
(float) 混合检索模式下语意检索的权重设置
+ - top_k
(integer) 返回结果数量,非必填
+ - score_threshold_enabled
(bool) 是否开启 score 阈值
+ - score_threshold
(float) Score 阈值
部分团队成员 ID 列表(选填)
@@ -600,16 +613,56 @@ import { Row, Col, Properties, Property, Heading, SubProperty, PropertyInstructi
```bash {{ title: 'cURL' }}
- curl --location --request POST '${props.apiBaseUrl}/datasets/{dataset_id}' \
+ curl --location --request PATCH '${props.apiBaseUrl}/datasets/{dataset_id}' \
--header 'Authorization: Bearer {api_key}' \
--header 'Content-Type: application/json' \
- --data-raw '{"name": "Test Knowledge Base", "indexing_technique": "high_quality", "permission": "only_me",\
- "embedding_model_provider": "zhipuai", "embedding_model": "embedding-3", "retrieval_model": "", "partial_member_list": []}'
+ --data-raw '{
+ "name": "Test Knowledge Base",
+ "indexing_technique": "high_quality",
+ "permission": "only_me",
+ "embedding_model_provider": "zhipuai",
+ "embedding_model": "embedding-3",
+ "retrieval_model": {
+ "search_method": "keyword_search",
+ "reranking_enable": false,
+ "reranking_mode": null,
+ "reranking_model": {
+ "reranking_provider_name": "",
+ "reranking_model_name": ""
+ },
+ "weights": null,
+ "top_k": 1,
+ "score_threshold_enabled": false,
+ "score_threshold": null
+ },
+ "partial_member_list": []
+ }'
```