Authorizations
API-Key 鉴权。所有 API 请求都应在 Authorization HTTP Header 中包含你的 API-Key,格式为 Bearer {API_KEY}。强烈建议开发者把 API-Key 放在后端存储,而非分享或者放在客户端存储,以免 API-Key 泄露,导致财产损失。
Path Parameters
要检索的知识库 ID。
对知识库执行搜索查询以检索最相关的块(段落)。此端点可用于生产检索和测试检索。
curl --request POST \
--url http://{apiBaseUrl}/datasets/{dataset_id}/retrieve \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"query": "<string>",
"retrieval_model": {
"search_method": "hybrid_search",
"reranking_enable": true,
"reranking_mode": {
"reranking_provider_name": "<string>",
"reranking_model_name": "<string>"
},
"top_k": 123,
"score_threshold_enabled": true,
"score_threshold": 123,
"weights": 123,
"metadata_filtering_conditions": {
"logical_operator": "and",
"conditions": [
{
"name": "<string>",
"comparison_operator": "<string>",
"value": "<string>"
}
]
}
}
}
'{
"query": {
"content": "<string>"
},
"records": [
{
"segment": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"position": 123,
"document_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"content": "<string>",
"answer": "<string>",
"word_count": 123,
"tokens": 123,
"keywords": [
"<string>"
],
"index_node_id": "<string>",
"index_node_hash": "<string>",
"hit_count": 123,
"enabled": true,
"disabled_at": 123,
"disabled_by": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "<string>",
"created_by": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": 123,
"indexing_at": 123,
"completed_at": 123,
"error": "<string>",
"stopped_at": 123,
"document": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"data_source_type": "<string>",
"name": "<string>"
}
},
"score": 123
}
]
}API-Key 鉴权。所有 API 请求都应在 Authorization HTTP Header 中包含你的 API-Key,格式为 Bearer {API_KEY}。强烈建议开发者把 API-Key 放在后端存储,而非分享或者放在客户端存储,以免 API-Key 泄露,导致财产损失。
要检索的知识库 ID。
此页面对您有帮助吗?
curl --request POST \
--url http://{apiBaseUrl}/datasets/{dataset_id}/retrieve \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"query": "<string>",
"retrieval_model": {
"search_method": "hybrid_search",
"reranking_enable": true,
"reranking_mode": {
"reranking_provider_name": "<string>",
"reranking_model_name": "<string>"
},
"top_k": 123,
"score_threshold_enabled": true,
"score_threshold": 123,
"weights": 123,
"metadata_filtering_conditions": {
"logical_operator": "and",
"conditions": [
{
"name": "<string>",
"comparison_operator": "<string>",
"value": "<string>"
}
]
}
}
}
'{
"query": {
"content": "<string>"
},
"records": [
{
"segment": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"position": 123,
"document_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"content": "<string>",
"answer": "<string>",
"word_count": 123,
"tokens": 123,
"keywords": [
"<string>"
],
"index_node_id": "<string>",
"index_node_hash": "<string>",
"hit_count": 123,
"enabled": true,
"disabled_at": 123,
"disabled_by": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "<string>",
"created_by": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": 123,
"indexing_at": 123,
"completed_at": 123,
"error": "<string>",
"stopped_at": 123,
"document": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"data_source_type": "<string>",
"name": "<string>"
}
},
"score": 123
}
]
}