mirror of
https://github.com/langgenius/dify-docs.git
synced 2026-03-29 13:48:35 +07:00
- Add checkbox (boolean) and object input types to start node documentation - Update conversation variables to support boolean and array[boolean] types - Add boolean-specific operators (is/is not) to if/else node documentation - Add array[boolean] operators (contains/not contains/empty checks) to if/else node - Update all three languages: English, Chinese (zh-hans), and Japanese (ja-jp) This change aligns with the core data type expansion PRD for Boolean & Object support. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
78 lines
3.6 KiB
Plaintext
78 lines
3.6 KiB
Plaintext
---
|
||
title: 条件分岐
|
||
version: '日本語'
|
||
---
|
||
|
||
### 定義
|
||
|
||
if/else 条件に基づいてチャットフローとワークフローを2つの分岐に分けることができます。
|
||
|
||
### ノードの機能
|
||
|
||
条件分岐の動作メカニズムには、次の6つのパスが含まれます:
|
||
|
||
* IFの条件:変数を選び、条件と満たすべき値を設定します;
|
||
* IFの条件が `True` と判断された場合、IFパスを実行します;
|
||
* IFの条件が `False` と判断された場合、ELSEパスを実行します;
|
||
* ELIFの条件が `True` と判断された場合, ELIFパスを実行します;
|
||
* ELIFの条件が `False` と判断された場合, 次のELIFパスを判断します、もしくは最後のELIFパスを実行します;
|
||
|
||
**条件の種類**
|
||
|
||
利用可能な条件タイプは変数のデータ型によって異なります:
|
||
|
||
**文字列/数値/オブジェクト変数の場合:**
|
||
* 含む(Contains)
|
||
* 含まない(Not contains)
|
||
* ..から始まる(Start with)
|
||
* ..から終わる(End with)
|
||
* である(Is)
|
||
* ではない(Is not)
|
||
* 空である(Is empty)
|
||
* 空ではない(Is not empty)
|
||
|
||
**ブール値変数の場合:**
|
||
* である(Is)- 真/偽
|
||
* ではない(Is not)- 真/偽
|
||
|
||
**ブール値配列変数の場合:**
|
||
* 含む(Contains)- 真/偽
|
||
* 含まない(Not contains)- 真/偽
|
||
* 空である(Is empty)
|
||
* 空ではない(Is not empty)
|
||
|
||
***
|
||
|
||
### シナリオ
|
||
|
||
<Frame>
|
||
<img src="https://assets-docs.dify.ai/dify-enterprise-mintlify/jp/guides/workflow/node/0ac5b007b9fb6c1c22e2c9ea7c00dac5.png" alt="" />
|
||
</Frame>
|
||
|
||
**テキスト要約ワークフロー**を例に、各条件を説明します。
|
||
|
||
* IFの条件:開始ノードの`summarystyle`変数を選び、条件を **含む** として `技術` を設定します;
|
||
* IFの条件が `True` と判断された場合、IFパスを実行し、技術関連の知識をナレッジ検索ノードを通じて問い合わせ、その後大規模言語モデル(LLM)ノードを介して応答します。(上図の下半部分に示されるように);
|
||
* IFの条件が `False` と判断され、さらにELIF条件が加えられた場合、`summarystyle` 変数の入力に `技術` は含まれず、ELIFの条件に `科学` が含まれている場合は、ELIFの条件が `True` であるかどうかを確認し、該当する手順を実行します。
|
||
* ELIFの条件が `False` で、かつ入力変数に `技術` や `科学` が含まれていない場合は、次のELIFの条件の評価を続けるか、もしくはELSEパスを実行します。
|
||
* IFの条件が `False` と判断された場合、つまり`summarystyle`変数の入力が **含まない** として `技術` を設定し、ELSEパスを実行し、LLM2ノードで返信します(上図の下半部分に示されるように);
|
||
|
||
**複数条件の判断**
|
||
|
||
複雑な条件判断が必要な場合、複数条件を設定し、条件間に **AND** または **OR** を設定することができます。これは条件間に**交集**または**并集**を取ることを意味します。
|
||
|
||
<Frame caption="複数条件の判断" width="369">
|
||
<img src="https://assets-docs.dify.ai/dify-enterprise-mintlify/jp/guides/workflow/node/098cf0cb913048464ed270cee12acde7.png" alt="" />
|
||
</Frame>
|
||
|
||
{/*
|
||
Contributing Section
|
||
DO NOT edit this section!
|
||
It will be automatically generated by the script.
|
||
*/}
|
||
|
||
---
|
||
|
||
[このページを編集する](https://github.com/langgenius/dify-docs/edit/main/ja-jp/guides/workflow/node/ifelse.mdx) | [問題を報告する](https://github.com/langgenius/dify-docs/issues/new?template=docs.yml)
|
||
|