HARPA.AI
LIBRARYUSE CASESGUIDESAI COMMANDSBLOG

Termination Steps

CONTENTS

# CLEAR

This step is equivalent to entering the command /clear in the chat, erases chat history and restarts it from scratch:

Typically added at the beginning of the dialog flow, this step clears AI history and parameter values. It aids in crafting prompts with intricate structures where having an empty chat history is important.

ChatML declaration

- type: clear

# STOP

Stop step terminates current step group.

ChatML declaration

- type: stop

The STOP step halts the current step group or, if none exist, the entire command.

In the following example, there are two scenarios for utilizing the STOP step:

  1. Clicking 'โœ… DONE' will terminate the entire command if no text manipulation is required.

  2. Clicking '๐Ÿ› ๏ธ CUSTOM TRANSLATE' activates a step group. First, the user enters a custom language; then the text is translated into that language. After completing the task, the STOP step is triggered, terminating the command's execution.

- type: ask
  label: ask-for-change
  param: change
  options:
    - { label: 'โœ… DONE', value: 'no' }
    - { label: '๐Ÿ‡ซ๐Ÿ‡ท TRANSLATE TO FRENCH', value: 'french' }
    - { label: '๐Ÿ› ๏ธ CUSTOM TRANSLATE', value: 'custom'}

- condition: '{{change}} = no'
  type: stop

- condition: '{{change}} = french'
  type: gpt
  prompt: >-
    Translate this text to French.

    Translated text:
- condition: '{{change}} = french'
  type: jump
  to: ask-for-change

- condition: '{{change}} = custom'
  type: group
  steps:
  - type: ask
    param: translate
    message: >
      Please specify target language:
  - type: gpt
    prompt: >-
      Please translate the answer you have written into
      the language I will specify below.
      Do not change the wording of the text; I only need the translation.

      [LANGUAGE]: {{translate}}

      Translated text:
  - type: stop
NEXT POST
Contact us
HomeUse CasesGuidesPrivacy PolicyTerms of Service