MyShell
  • About MyShell
    • What is MyShell
    • MyShell in a Nutshell
    • Quickstart
  • Explore AI Agents
    • Image Generation
    • Video Generation
    • Meme Generation
    • Role-Playing Game
    • Character
    • Utility
  • Create AI Agents
    • Classic Mode
      • Enhanced Prompt
      • Knowledge Base
      • Telegram Integration
    • Pro Config Mode
      • Core Concepts
      • Tutorial
        • Tutorial Structure
        • Hello World with Pro Config
        • Building Workflow
        • Transitions
        • Expressions and Variables
        • Integration with Any Widget
        • An Advanced Example
      • Basic
        • Common
        • Atomic State
        • Transition
        • Automata
        • Modules
      • Advanced
        • Cron Pusher
        • Neutral Language To SD Prompt
        • Advanced Input Validation
        • Advanced Memory Manager in Prompt Widget
      • Tools
        • AutoConfig Agent
        • Cache Mode
        • Knowledge Base Agent
        • Crawler Widget
      • Example
        • Homeless With You
        • Random Routing
        • Function Calling
      • API Reference
        • Atomic State
        • Transition
        • Automata
        • Context
        • Module
          • AnyWidget Module
            • Prompt Widget
            • LLM Widget
            • TTS Widget
            • Code Runner Widget
            • Melo TTS
            • Age Transformation
            • ChatImg
            • GIF Generation
            • Music Generation
          • LLM Module
          • LLM Function Module
          • TTS Module
          • Google Search Module
        • Widgets
          • Bark TTS
          • Champ
          • CoinGecko
          • ControlNet with Civitai
          • Crawler
          • Crypto News
          • Data Visualizer
          • Email Sender
          • Google Flight Search
          • Google Hotel Search
          • Google Image Search
          • Google Map Search
          • Google News Search
          • Google Scholar Search
          • Google Search
          • GroundedSAM
          • Image Text Fuser
          • Information Extractor - OpenAI Schema Generator
          • Information Extractor
          • Instagram Search
          • JSON to Table
          • LinkedIn
          • MS Word to Markdown
          • Markdown to MS Word
          • Markdown to PDF
          • Mindmap Generator
          • Notion Database
          • OCR
          • Pdf to Markdown
          • RMBG
          • Stabel-Video-Diffusion
          • Stable Diffusion Inpaint
          • Stable Diffusion Recommend
          • Stable Diffusion Transform
          • Stable Diffusion Upscale
          • Stable Diffusion with 6 fixed category
          • Stable Diffusion with Civitai
          • Storydiffusion
          • Suno Lyrics Generator
          • Suno Music Generator
          • Table to Markdown
          • TripAdvisor
          • Twitter Search
          • UDOP: Document Question Answering
          • Weather forecasting
          • Whisper large-v3
          • Wikipedia
          • Wolfram Alpha Search
          • Yelp Search
          • YouTube Downloader
          • YouTube Transcriber
          • Youtube Search
      • FAQs
      • Changelog
    • ShellAgent Mode
      • Download and Installation
      • App Builder
      • Workflow
      • Build Custom Widget
      • Publish to MyShell
      • Customized Pricing For Your Agent
      • Example
        • Child Book X Agent w/ DeepSeek
        • Kids Book NFT AI Agent w/ BNB Chain
        • DeFAI Agent w/ BNB Chain
  • Shell Launchpad
    • How to Launch a Token
    • Trade Agent Tokens
  • Tokenomics
    • $SHELL Basics
    • $SHELL Token Utility
    • How to Obtain $SHELL
    • Roadmap
  • Open-source AI Framework/SDK
    • ShellAgent
    • OpenVoice
    • MeloTTS
    • JetMoE
    • AIlice
  • Links
Powered by GitBook
On this page
  • Naming
  • Expression
  1. Create AI Agents
  2. Pro Config Mode
  3. Basic

Common

Naming

For any user-defined variable or key names, we mandate the use of lowercase snake_case format. Be aware that names incorporating any special characters, apart from periods (.), may result in unpredictable behaviour. Please review documentation to determine permissible use of periods (dots).

Uppercase names are exclusively reserved for specific, system-defined uses.

Field names in AtomicState and Automata are also reserved to prevents issues.

Example:

// correct:
{
  "context": {
    "prompt": {},
    "other_var": {}
  },
  "states": {
    "home_page": {},
    "chat": {
      "outputs": {
        "context.prompt": ""
      },
      "transitions": {
        "goto.some_place": {}
      }
    }
  }
}

// wrong:
{
  "context": {
    "outputs": {}, // use reserved field name
    "otherVar": {}, // not snake_case
    "$var": {}, // use special characters
    "a.b": {} // dots are not allowed for context
  },
  "states": {
    "inputs": {}, // use reserved field name
    "$var": {}, // use special characters
    "a.b": {}, // dots are not allowed for states
    "Chat": {
      // not snake_case
      "outputs": {
        "inputs.prompt": "" // use reserved field name as namespace
      },
      "transitions": {
        "..some_place": {} // consective dots are not allowed for transition keys
      }
    }
  }
}

Expression

An Expression is a string using double curly brackets that allows you to reference accessible variables. You're free to use Expression anywhere a simple string is anticipated. When you're dealing with other fields requiring a different type, only expressions that result in the expected type are valid. Take for instance a condition field that demands a boolean—you can only pass boolean expressions like "{{ 10 > 5 }}" in that case.

The variables' accessibility is determined by the sequence in which AtomicState and Automata execute.

For AtomicState, the order is: inputs create variables, followed by tasks, then outputs, and finally, render, which does not create variables.

In Automata, variables are processed in this sequence: inputs, then context, followed by sequence of states, and lastly outputs.

The supported ECMAScript 6+ features include:

  • Block-scoped declaration (let and const)

  • ES6 class support

  • Arrow functions

  • Template literals

  • Destructuring assignments

  • Default function parameters

  • Spread and rest properties

  • Optional chaining

  • Nullish coalescing operator

  • Symbol

  • Map, Set

  • Proxy

  • Typed Arrays

  • Reflect

  • for-of

  • Optional catch binding

PreviousBasicNextAtomic State

Last updated 1 year ago

The expression could be written in , adhering to the standard plus certain ECMAScript 6+ features.

JavaScript
ECMAScript 5.1