Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

switch.mdx 2.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. ---
  2. sidebar_position: 9
  3. slug: /switch_component
  4. ---
  5. # Switch component
  6. A component that evaluates whether specified conditions are met and directs the follow of execution accordingly.
  7. ---
  8. A **Switch** component evaluates conditions based on the output of specific components, directing the flow of execution accordingly to enable complex branching logic.
  9. ## Scenarios
  10. A **Switch** component is essential for condition-based direction of execution flow. While it shares similarities with the [Categorize](./categorize.mdx) component, which is also used in multi-pronged strategies, the key distinction lies in their approach: the evaluation of the **Switch** component is rule-based, whereas the **Categorize** component involves AI and uses an LLM for decision-making.
  11. ## Configurations
  12. ### Case n
  13. A **Switch** component must have at least one case, each with multiple specified conditions and *only one* downstream component. When multiple conditions are specified for a case, you must set the logical relationship between them to either AND or OR.
  14. #### Next step
  15. Specifies the downstream component of this case.
  16. - *Once you specify the ID of the downstream component, a link is established between this case and the corresponding component.*
  17. - *If you manually link this case to a downstream component on the canvas, the ID of that component is auto-populated.*
  18. #### Condition
  19. Evaluates whether the output of specific components meets certain conditions, with **Component ID**, **Operator**, and **Value** together forming a conditional expression.
  20. :::danger IMPORTANT
  21. When you have added multiple conditions for a specific case, a **Logical operator** field appears, requiring you to set the logical relationship between these conditions as either AND or OR.
  22. ![Image](https://github.com/user-attachments/assets/102f006e-9906-49c2-af43-de6af03d5074)
  23. :::
  24. - **Component ID**: The ID of the corresponding component.
  25. - **Operator**: The operator required to form a conditional expression.
  26. - Equals
  27. - Not equal
  28. - Greater than
  29. - Greater equal
  30. - Less than
  31. - Less equal
  32. - Contains
  33. - Not contains
  34. - Starts with
  35. - Ends with
  36. - Is empty
  37. - Not empty
  38. - **Value**: A single value, which can be an integer, float, or string.
  39. - Delimiters, multiple values, or expressions are *not* supported.
  40. - Strings need not be wrapped in `""` or `''`.
  41. ### ELSE
  42. **Required**. Specifies the downstream component if none of the conditions defined above are met.
  43. *Once you specify the ID of the downstream component, a link is established between ELSE and the corresponding component.*