ナレッジベース詳細を取得
ナレッジベースの詳細情報(埋め込みモデル、検索設定、ドキュメント統計を含む)を返します。
curl --request GET \
--url https://{api_base_url}/datasets/{dataset_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://{api_base_url}/datasets/{dataset_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{api_base_url}/datasets/{dataset_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{api_base_url}/datasets/{dataset_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{api_base_url}/datasets/{dataset_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{api_base_url}/datasets/{dataset_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{api_base_url}/datasets/{dataset_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "c42e2a6e-40b3-4330-96f8-f1e4d768e8c9",
"name": "Product Documentation",
"description": "プロダクト API 技術ドキュメント",
"provider": "vendor",
"permission": "only_me",
"data_source_type": null,
"indexing_technique": "high_quality",
"app_count": 0,
"document_count": 0,
"word_count": 0,
"created_by": "ad313dd6-ef04-4dd1-a5b0-c0f0b9e2e7e4",
"author_name": "admin",
"created_at": 1741267200,
"updated_by": "ad313dd6-ef04-4dd1-a5b0-c0f0b9e2e7e4",
"updated_at": 1741267200,
"embedding_model": "text-embedding-3-small",
"embedding_model_provider": "langgenius/openai/openai",
"embedding_available": true,
"retrieval_model_dict": {
"search_method": "semantic_search",
"reranking_enable": false,
"reranking_mode": null,
"reranking_model": {
"reranking_provider_name": "",
"reranking_model_name": ""
},
"weights": null,
"top_k": 3,
"score_threshold_enabled": false,
"score_threshold": null
},
"tags": [],
"doc_form": "text_model",
"external_knowledge_info": null,
"external_retrieval_model": null,
"doc_metadata": [],
"built_in_field_enabled": true,
"pipeline_id": null,
"runtime_mode": null,
"chunk_structure": null,
"icon_info": null,
"summary_index_setting": null,
"is_published": false,
"total_documents": 0,
"total_available_documents": 0,
"enable_api": true,
"is_multimodal": false,
"maintainer": "admin"
}{
"status": 403,
"code": "forbidden",
"message": "Dataset api access is not enabled."
}{
"status": 404,
"code": "not_found",
"message": "Dataset not found."
}Authorizations
すべてのリクエストは API キーで認証します:Authorization: Bearer {API_KEY}。アプリのエンドポイントにはアプリの API キーを、ナレッジのエンドポイントにはナレッジベースの API キーを使用します(Dify API クイックスタート)。
キーはサーバーサイドで保管し、クライアントコードには決して埋め込まないでください。キーが欠落または無効なリクエストは HTTP 401(unauthorized)で失敗します。
Path Parameters
ナレッジベース ID です。ナレッジベースリストを取得 から取得します。
Response
ナレッジベースの詳細です。
ナレッジベースの一意識別子です。
ナレッジベースの表示名です。ワークスペース内で一意です。
ナレッジベースの目的または内容を説明するオプションのテキストです。
プロバイダータイプです。内部管理の場合は vendor、外部ナレッジベース接続の場合は external です。
このナレッジベースにアクセスできるユーザーを制御します。指定可能な値:only_me、all_team_members、partial_members。
ドキュメントのデータソースタイプです。まだ設定されていない場合は null です。
high_quality は埋め込みモデルを使用した精密検索、economy はキーワードベースのインデキシングです。
現在このナレッジベースを使用しているアプリケーションの数です。
ナレッジベース内のドキュメント総数です。
全ドキュメントの合計単語数です。
ナレッジベースを作成したユーザーの ID です。
作成者の表示名です。
作成タイムスタンプ(Unix エポック、秒単位)です。
ナレッジベースを最後に更新したユーザーの ID です。
最終更新タイムスタンプ(Unix エポック、秒単位)です。
インデックス作成に使用される埋め込みモデルの名前です。
埋め込みモデルプロバイダーの識別子です。organization/plugin_name/provider_name の形式です(例:langgenius/openai/openai)。以前のナレッジベースでは短縮形(例:openai)が返される場合があります。
設定された埋め込みモデルが現在利用可能かどうかです。
ナレッジベースの検索設定です。
Show child attributes
Show child attributes
サマリーインデックスの設定です。
Show child attributes
Show child attributes
このナレッジベースに関連付けられたタグです。
Show child attributes
Show child attributes
ドキュメントのチャンキングモードです。text_model は標準テキストチャンキング、hierarchical_model は親子構造、qa_model は QA ペア抽出を示します。
外部ナレッジベースの接続詳細です。provider が external の場合に存在します。
Show child attributes
Show child attributes
外部ナレッジベースの検索設定です。内部ナレッジベースの場合は null です。
Show child attributes
Show child attributes
ナレッジベースのメタデータフィールド定義です。
Show child attributes
Show child attributes
組み込みメタデータフィールド(例:document_name、uploader)が有効かどうかです。
カスタム処理パイプラインが設定されている場合のパイプライン ID です。
ランタイム処理モードです。
チャンク構造の設定です。
ナレッジベースのアイコン表示設定です。
Show child attributes
Show child attributes
ナレッジベースが公開済みかどうかです。
ドキュメントの合計数です。
有効で利用可能なドキュメントの数です。
このナレッジベースで API アクセスが有効かどうかです。
マルチモーダルコンテンツ処理が有効かどうかです。
ナレッジベースのメンテナーの表示名です。設定されていない場合は null です。
permission が partial_members の場合にアクセスを許可されたメンバーのアカウント ID です。更新レスポンスでは常に含まれ、詳細レスポンスでは permission が partial_members の場合にのみ含まれます。
Was this page helpful?
curl --request GET \
--url https://{api_base_url}/datasets/{dataset_id} \
--header 'Authorization: Bearer <token>'import requests
url = "https://{api_base_url}/datasets/{dataset_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://{api_base_url}/datasets/{dataset_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{api_base_url}/datasets/{dataset_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://{api_base_url}/datasets/{dataset_id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://{api_base_url}/datasets/{dataset_id}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://{api_base_url}/datasets/{dataset_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "c42e2a6e-40b3-4330-96f8-f1e4d768e8c9",
"name": "Product Documentation",
"description": "プロダクト API 技術ドキュメント",
"provider": "vendor",
"permission": "only_me",
"data_source_type": null,
"indexing_technique": "high_quality",
"app_count": 0,
"document_count": 0,
"word_count": 0,
"created_by": "ad313dd6-ef04-4dd1-a5b0-c0f0b9e2e7e4",
"author_name": "admin",
"created_at": 1741267200,
"updated_by": "ad313dd6-ef04-4dd1-a5b0-c0f0b9e2e7e4",
"updated_at": 1741267200,
"embedding_model": "text-embedding-3-small",
"embedding_model_provider": "langgenius/openai/openai",
"embedding_available": true,
"retrieval_model_dict": {
"search_method": "semantic_search",
"reranking_enable": false,
"reranking_mode": null,
"reranking_model": {
"reranking_provider_name": "",
"reranking_model_name": ""
},
"weights": null,
"top_k": 3,
"score_threshold_enabled": false,
"score_threshold": null
},
"tags": [],
"doc_form": "text_model",
"external_knowledge_info": null,
"external_retrieval_model": null,
"doc_metadata": [],
"built_in_field_enabled": true,
"pipeline_id": null,
"runtime_mode": null,
"chunk_structure": null,
"icon_info": null,
"summary_index_setting": null,
"is_published": false,
"total_documents": 0,
"total_available_documents": 0,
"enable_api": true,
"is_multimodal": false,
"maintainer": "admin"
}{
"status": 403,
"code": "forbidden",
"message": "Dataset api access is not enabled."
}{
"status": 404,
"code": "not_found",
"message": "Dataset not found."
}