HARPA.AI
LIBRARYUSE CASESGUIDESAI COMMANDSBLOG

Basic Steps

CONTENTS

# Basic steps

The basic automation steps include SAY, ASK, and GPT. These steps are used to create a conversation flow between you, the user, and AI.

  • SAY prints a message to chat.
  • ASK asks user for a parameter value.
  • GPT sends a prompt to AI, prints response to chat and stores it as a parameter.

# SAY

Use SAY step to instruct HARPA to send a message to chat. This is handy to write instructions, reminders or echo parameter values. AI parameters are explained in Parameters page.

The SAY step supports markdown syntax, enabling you to format and enhance your message with headings, lists, tables, links and images.

ChatML declaration

# full version
- type: say
  message: Hello world!

# short version
- say: Hello world!

# ASK

ASK step allows dialog flow customization. It declares a question displayed in chat, parameter name, and a default value.

Whenever HARPA runs ASK step, it will print a question in chat, wait for your input, and store your response in a parameter, e.g. p1. Parameter then be referenced in other steps, e.g. SAY and GPT, by referencing it with a {{p1}} placeholder.

Parameter takes default value if user input is not provided (skipped by pressing Enter)

ChatML

# full version
- type: ask
  param: p1

# short version
- ask: p1

# default fallback value
- ask: p1
  default: '{{page}}'

# choice of options
- ask: option
  options: ['a', 'b', 'c']

# choice of options, with a custom one
- ask: option
  options: ['a', 'b', 'c', '$custom']

# choice of options with labels and values
- ask: option
  options:
    - { label: 'MAKE LONGER', value: 'make text longer' }
    - { label: 'MAKE SHORTER', value: 'make text shorter' }

The value provided by user is stored in the command context under parameter name (p1 and option in the example above).

# GPT

GPT step sends a prompt to a Large Language Model, e.g. OpenAI GPT, Google Gemini or Claude3.

There is no special vocabulary for writing GPT prompts in HARPA AI. You can define any AI prompt and reference parameters.

GPT prompts undergo parameters interpolation, which means ChatML engine will insert parameter values into the prompt string if it contains parameter references in double curly brackets, such as {{language}}, {{page}}, {{param}} etc.

ChatML declaration

# full version
- type: gpt
  prompt: >
    Please ignore all previous instructions. Please provide 5 not so well known / surprising facts about {{p1}}. Format every fact:

    - [relevant fact emoji] [fact]

    Facts:
  param: gpt

# short version
- gpt: >
    Please ignore all previous instructions. Please provide 5 not so well known / surprising facts about {{p1}}. Format every fact:

    - [relevant fact emoji] [fact]

    Facts:

icon

GPT response is stored in the parameter, named gpt. You can reference it in other steps, e.g. SAY, or chain multiple GPT steps together.

# Example

The following command generates domain names from keyword and topic. Custom command utilizes two steps - ASK and GPT:

ChatML declaration

meta:
  title: Domain name generator
  description: ''
  category: User
  name: hdruHBqvUDI3t2ymTDqU4
steps:
  - type: ask
    param: p1
    message: >-
      Enter your niche, product/service/business description, or leave empty
      to parse from page
    default: '{{page}}'
  - type: gpt
    prompt: >-
      Please ignore all previous instructions.
      I want you to respond only in {{language}}.

      Generate 20 domain name ideas for the given topic, niche or
      product/business/service description which have some search volume.

      Try to come up with domain names that are available and not already
      used by other companies.

      [TOPIC / NICE / PRODUCT / BUSINESS / SERVICE
      DESCRIPTION]: {{pi}]

      [DOMAIN NAMES LIST]:
version: 1
NEXT POST
Contact us
HomeUse CasesGuidesPrivacy PolicyTerms of Service