獲取參考知識
獲取參考知識
檢索智能代理回應中引用的知識庫片段數據,包括片段內容、文件 ID、文件名稱、來源網址與語義相關性得分。
請求方式
GET
請求 URL
https://api-${endpoint}.gptbots.ai/v1/correlate/dataset
請求驗證
您可以參考 API 概覽 獲取身份驗證的相關說明。
請求
請求範例
curl -X GET 'https://api-${endpoint}.gptbots.ai/v1/correlate/dataset?message_id=65e04591a0e1e42392696d78' \
-H 'Authorization: Bearer ${API Key}' \
curl -X GET 'https://api-${endpoint}.gptbots.ai/v1/correlate/dataset?message_id=65e04591a0e1e42392696d78' \
-H 'Authorization: Bearer ${API Key}' \
此代碼塊在浮窗中顯示
請求標頭
| 字段 | 類型 | 說明 |
|---|---|---|
| Authorization | Bearer(持有者)${API Key} | 使用 Authorization: Bearer ${API Key} 進行身份驗證。您可以從 API Key 頁面獲取 API 金鑰。 |
請求參數
| 字段 | 類型 | 必填 | 說明 |
|---|---|---|---|
| message_id | string | 是 | 智能代理回應的訊息 ID。 |
回應
回應範例
{
"conversation_id": "65dc320df07244300b25b993",
"question_id": "65dc323ef07244300b25b9c5",
"answer_id": "65dc323ef07244300b25b9c6",
"correlate_dataset": [
{
"content": "The Great Wall of China was built to resist the invasion of northern nomadic tribes.",
"data_id": "65dc3234f07244300b25b9b9",
"data_name": "Chinese History",
"source_url": "https://www.example.com/chinese-history",
"score": 0.93492633
}
]
}
{
"conversation_id": "65dc320df07244300b25b993",
"question_id": "65dc323ef07244300b25b9c5",
"answer_id": "65dc323ef07244300b25b9c6",
"correlate_dataset": [
{
"content": "The Great Wall of China was built to resist the invasion of northern nomadic tribes.",
"data_id": "65dc3234f07244300b25b9b9",
"data_name": "Chinese History",
"source_url": "https://www.example.com/chinese-history",
"score": 0.93492633
}
]
}
此代碼塊在浮窗中顯示
成功回應
| 字段 | 類型 | 說明 |
|---|---|---|
| conversation_id | string | 對話 ID |
| question_id | string | 用戶問題的訊息 ID |
| answer_id | string | 智能代理回應的訊息 ID |
| correlate_dataset | JSON 陣列格式 | 相關數據集 |
| content | string | 知識庫片段內容 |
| data_id | string | 文件 ID |
| data_name | string | 文件名稱 |
| source_url | string | 文件來源網址 |
| score | string | 知識庫片段與問題的語義相關性得分。 |
失敗回應
| 字段 | 類型 | 說明 |
|---|---|---|
| code | int | 錯誤代碼。 |
| message | string | 錯誤訊息。 |
錯誤代碼
| 錯誤代碼 | 錯誤訊息 |
|---|---|
| 40000 | 無效參數 |
| 40379 | 點數不足 |
| 200222 | 智能代理配置不支援此功能。 |
| 40378 | 智能代理已刪除 |
| 20055 | API 被禁止 |
| 40127 | 開發者身份驗證失敗 |
