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
  • 1. Try it, Hands-on
  • 2. Adjust the parameters
  • 3. Copy the widget Pro Config template (it's an independent automata that includes that widget as a task)
  • 4. Modify Pro Config according to the copied config
  1. Create AI Agents
  2. Pro Config Mode
  3. Tutorial

Integration with Any Widget

PreviousExpressions and VariablesNextAn Advanced Example

Last updated 4 months ago

MyShell currently supports over a thousand widgets with diverse functionalities, including prompt widgets, voice widgets, image generation widgets, and many more, in which all you could find on our widget center.

The AnyWidget Module for Pro Config is designed to be versatile. For instance, constructing a video generation agent that combines ASR, TTS, LipSync, and AutoCaption widgets is within the realm of possibilities.

As introduced beforehand, after you get into MyShell's Widget center, there a numerous widgets where you could play with and insert that into your Pro Config. We suggest to follow these steps before you implement it in Pro Config.

1. Try it, Hands-on

2. Adjust the parameters

3. Copy the widget Pro Config template (it's an independent automata that includes that widget as a task)

{
  "id": "prompt_widget_template",
  "initial": "home_state",
  "states": {
    "home_state": {
      "inputs": {
        "prompt_a": {
          "type": "text",
	  "description":"The prompt for your audio",
          "user_input": true
        }
      },
      "tasks": [
        {
          "name": "any_module_example_task",
          "module_type": "AnyWidgetModule",
          "module_config": {
            "widget_id": "1743838636299784192",            
            "prompt_a":"{{prompt_a}}", // this field will received value from user input
            "denoising":0.75, // How much to transform input spectrogram
            "prompt_b":"90's rap", // The second prompt to interpolate with the first, leave blank if no interpolation
            "alpha":0.5, // Interpolation alpha if using two prompts. A value of 0 uses prompt_a fully, a value of 1 uses prompt_b fully
            "num_inference_steps":50, // Number of steps to run the diffusion model
            "seed_image_id":"vibes", // Seed spectrogram to use
            "output_name": "result"
          }
        }
      ],
      "render": {
        "text": "{{JSON.stringify(result)}}", // this widget will output a map, you can first run it and know what its type is.
        "buttons": [
          {
            "content":"Generate Again",
            "description":"",
            "on_click":"generate"
          }
        ]
      },
      "transitions": {
        "generate": "home_state"
      }
    }
  }
}

4. Modify Pro Config according to the copied config

The following JSON is invalid since we just copy the template without changing anything.

{
  "type": "automata",
  "id": "chat_demo",
  "initial": "chat_page_state",
  "inputs": {},
  "outputs": {},
  "transitions": {},
  "states": {
    "chat_page_state": {
      "inputs": {
        "user_message": {
          "type": "IM",
          "user_input": true
        }
      },
      "tasks": [
        {
          "name": "generate_reply",
          "module_type": "AnyWidgetModule",
          "module_config": {
            "widget_id": "1744214024104448000",
            "system_prompt": "You are a teacher teaching Pro Config.",
            "user_prompt": "{{user_message}}",
            "output_name": "reply"
          }
        },
        {
          "name": "any_module_example_task",
          "module_type": "AnyWidgetModule",
          "module_config": {
            "widget_id": "1743838636299784192",            
            "prompt_a":"{{prompt_a}}", // this field will received value from user input
            "denoising":0.75, // How much to transform input spectrogram
            "prompt_b":"90's rap", // The second prompt to interpolate with the first, leave blank if no interpolation
            "alpha":0.5, // Interpolation alpha if using two prompts. A value of 0 uses prompt_a fully, a value of 1 uses prompt_b fully
            "num_inference_steps":50, // Number of steps to run the diffusion model
            "seed_image_id":"vibes", // Seed spectrogram to use
            "output_name": "result"
          }
        }
      ],
      "render": {
        "text": "{{reply}}",
        "audio": "{{reply_voice}}"
      },
      "transitions": {
        "CHAT": "chat_page_state"
      }
    }
  }
}

Then the variables' names may be changed to fit the original config. "prompt_a":"{{prompt_a}}" needs to be changed to "prompt_a":"{{reply}}". render also needs to be changed.

You may find it necessary to add more inputs or outputs to use the widget, because widgets often require parameters you don't anticipate.

{
  "type": "automata",
  "id": "chat_demo",
  "initial": "chat_page_state",
  "inputs": {},
  "outputs": {},
  "transitions": {},
  "states": {
    "chat_page_state": {
      "inputs": {
        "user_message": {
          "type": "IM",
          "user_input": true
        }
      },
      "tasks": [
        {
          "name": "generate_reply",
          "module_type": "AnyWidgetModule",
          "module_config": {
            "widget_id": "1744214024104448000",
            "system_prompt": "You are a teacher teaching Pro Config.",
            "user_prompt": "{{user_message}}",
            "output_name": "reply"
          }
        },
        {
          "name": "any_module_example_task",
          "module_type": "AnyWidgetModule",
          "module_config": {
            "widget_id": "1743838636299784192",            
            "prompt_a":"{{reply}}", // this field will received value from user input
            "denoising":0.75, // How much to transform input spectrogram
            "prompt_b":"90's rap", // The second prompt to interpolate with the first, leave blank if no interpolation
            "alpha":0.5, // Interpolation alpha if using two prompts. A value of 0 uses prompt_a fully, a value of 1 uses prompt_b fully
            "num_inference_steps":50, // Number of steps to run the diffusion model
            "seed_image_id":"vibes", // Seed spectrogram to use
            "output_name": "result"
          }
        }
      ],
      "render": {
        "text": "{{JSON.stringify(result)}}", // this widget will output a map, you can first run it and know what its type is.
      },
      "transitions": {
        "CHAT": "chat_page_state"
      }
    }
  }
}

Finally, adjust the module_config according to the parameters you have tried and decided in the step 2.

For example, the original Pro Config is the in the previous chapter. We may replace TtsModule with the music generation widget.

agent example