パイプラインを実行
ナレッジベースの完全なナレッジパイプラインを実行します。ストリーミングとブロッキングの両方のレスポンスモードをサポートしています。
curl --request POST \
--url https://{api_base_url}/datasets/{dataset_id}/pipeline/run \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"inputs": {},
"datasource_type": "local_file",
"datasource_info_list": [
{
"reference": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"name": "quarterly-report.pdf"
}
],
"start_node_id": "1719288585006",
"is_published": true,
"response_mode": "blocking"
}
'<string>{
"status": 400,
"code": "invalid_param",
"message": "Pipeline not found"
}{
"status": 403,
"code": "forbidden",
"message": "Dataset api access is not enabled."
}{
"status": 404,
"code": "not_found",
"message": "Dataset not found."
}{
"status": 500,
"code": "pipeline_run_error",
"message": "Pipeline execution failed: connection timeout"
}Authorizations
API Key 認証です。すべての API リクエストにおいて、Authorization HTTP ヘッダーに Bearer プレフィックスを付けた API Key を含めてください。例:Authorization: Bearer {API_KEY}。API Key はサーバーサイドに保存し、クライアントサイドで共有・保存しないことを強く推奨します。API Key の漏洩は深刻な結果につながる可能性があります。API Key が欠落または無効な場合、HTTP 401 とエラーコード unauthorized が返されます。
Path Parameters
ナレッジベース ID です。
Body
パイプライン入力変数のキーと値のペア。ワークフローで定義されたパイプライン変数に対応します。入力変数がない場合は {} を渡してください。
データソースのタイプ。datasource_info_list の各項目に必要なフィールドを決定します。
local_file, online_document, website_crawl, online_drive 処理対象のデータソースオブジェクトのリストです。項目の構造は datasource_type によって異なります。
- Local File
- Online Document
- Website Crawl
- Online Drive
Show child attributes
Show child attributes
パイプライン実行を開始するノードの ID です。
パイプラインの公開版またはドラフト版のどちらを実行するかを指定します。true は最新の公開版を実行し、false は現在のドラフトを実行します(未公開の変更をテストする場合に便利です)。
パイプライン実行のレスポンスモードです。streaming は Server-Sent Events ストリームを返し、blocking は完了まで待機して完全な結果を返します。
streaming, blocking Response
パイプライン実行結果。フォーマットは response_mode に依存します:ストリーミングは text/event-stream を返し、ブロッキングは完全な JSON 結果を返します。
Server-Sent Events ストリームです。各行は data: {JSON}\n\n 形式です。主要なイベント:workflow_started(実行開始)、node_started / node_finished(ノードごとの進捗、node_id、node_type、status、inputs、outputs を含む)、workflow_finished(最終結果、status、outputs、total_tokens、elapsed_time を含む)、ping(キープアライブ)。
Was this page helpful?
curl --request POST \
--url https://{api_base_url}/datasets/{dataset_id}/pipeline/run \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"inputs": {},
"datasource_type": "local_file",
"datasource_info_list": [
{
"reference": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"name": "quarterly-report.pdf"
}
],
"start_node_id": "1719288585006",
"is_published": true,
"response_mode": "blocking"
}
'<string>{
"status": 400,
"code": "invalid_param",
"message": "Pipeline not found"
}{
"status": 403,
"code": "forbidden",
"message": "Dataset api access is not enabled."
}{
"status": 404,
"code": "not_found",
"message": "Dataset not found."
}{
"status": 500,
"code": "pipeline_run_error",
"message": "Pipeline execution failed: connection timeout"
}