switch

A conditional system tool that executes different blocks of tools based on multiple conditions.

Fields

Name
Type
Description
Required

cases.condition_prompt

prompt

The true/false or yes/no question prompt to ask about the content.

cases.break

boolean

Whether to stop evaluating further cases if this condition is true. Defaults to false.

cases.tools

array

The tools to execute if the condition is true.

default.tools

array

The tools to execute if no conditions are true or no break was present.

content

prompt

The content to evaluate for each case.

Returns

Type
Description

null

This system tool does not return a value.

Example

- name: switch
  content: <content-to-switch-on>
  cases:
    - condition_prompt: <true-false-question-prompt>
      break: <if-true-break-out-of-switch>
      tools:
        - name: some_tool
    - condition_prompt: <true-false-question-prompt>
      break: <if-true-break-out-of-switch>
      tools:
        - name: some_tool
  default:
    tools:
      - name: some_tool

Last updated