MyShell 백서

MyShell

원문

bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 75쪽 중 34쪽

f09f1a2" alt=""><figcaption><p>Clear memory option in agent options</p></figcaption></figure> ### Q: My agent is stuck at message loading. What can I do to troubleshoot? First, identify which part of the pro config could be faulty. You can do this by determining which part of the flow the agent is getting stuck, and then looking at the tasks in the specific state. Check for any invalid configurations. If things still don’t work, separate tasks into different states to see which one of them could be causing problems. If nothing makes sense, feel free to contact us and we will do our best to help you out. ### Q: I have run out of batteries and I’m not done testing. What can I do to replenish the battery? We will gift a big battery recharge. Please contact us. ### Q: When I update the pro config for my agent, I’m not prompted to reset the bot memory. What should I do? This is a bug. Just go to the **Chat** tab and refresh the page. Now, you should see a prompt to reset the agent’s memory. ### Q: Some Random Error Message Explained * **Widget Call Error**: Stay rested. This is not your fault. This error is reported because the model host platform run out of GPU memory. It generally gets solved by waiting a couple of minutes. Another scenario could involve oversized input images (or other inputs). Consider using a smaller input size. <figure><img src="https://2975681513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDtmZwLatyyBFLUK6P6Pj%2Fuploads%2FeTQs7i7Z42vyEWcLJqHA%2Fimage.png?alt=media&amp;token=b3231cf5-a747-489c-9ad7-789ff8593ca5" alt=""><figcaption></figcaption></figure> # Changelog ### v0.91 #### Features * LLM widgets support knowledge base, which can be managed by [Knowledge Base Agent](/create/pro-config-mode/tools/knowledge-base-bot).&#x20; ### v0.9 #### Features * `render.buttons` supports the matrix of buttons to configure the number of rows and the number of buttons for each row. * `Input` supports `validations` which you can specify how the input should be validated, including if it is required or optional. * `Automata`, `AtomicState` and `AnyWidgetModule` support cache mode. ### v0.8.1 #### Features * `AnyWidgetModule` supports Code Runner widgets. ### v0.8.0 #### Features * `AnyWidgetModule` supports LLM widgets. {% hint style="info" %} `Module` will be deprecated in future and replaced by `Widget`. {% endhint %} #### Documentation * `LLMModule` and `TtsModule` in examples are replaced by `AnyWidgetModule` with LLM widgets and TTS widgets correspondingly. ### v0.7.0 #### Features * `Transition` supports `target_inputs` that specifies the value for the inputs of target state. * `Button` supports passing data through `on_click.payload` field. * MyShell supports copying any widget’s configuration JSON for Pro Config mode, containing necessary information about the inputs and outputs of that widget. {% hint style="warning" %} `UNSTABLE_button_id` will be deprecated in v1.0.0. Use `on_click.payload` and `target_inputs` instead. {% endhint %} ### v0.6.1 #### Features * Modules now support `AnyWidgetModule` that allows using any widget in MyShell Workshop. * Modules now support GoogleSearchModule for google search. ### v0.6.0 #### Breaking Changes * The `tasks` within `AtomicState` have been changed to an array format. The object syntax is no longer supported, which means the execution order cannot be guaranteed if the object syntax is used. #### Features * Transition now support conditional transitions. * Expressions now support ECMAScript 5.1 syntax and certain ECMAScript 6+ features. * The Button now supports passing parameters using the `UNSTABLE_button_id` property. #### Documentation * Corrected the PepeTalk Example. * Included a link to a more comprehensive tutorial. # ShellAgent Mode ShellAgent is the most powerful and modular Agentic Framework open-sourced by MyShell. It's deeply integrated into MyShell's ecosystem, allowing developers to build powerful AI agents, publish to MyShell, and earn rewards.\ \ The ShellAgent mode now supports **Windows**, **macOS**, and **Linux**. It requires **a decent GPU** to run on your own devices. Besides, we now provide a [**ShellAgent cloud version**](https://shellagent.myshell.ai) for all creators. Enjoy building your AI Agent online!\ \ The widget supports focus mainly on image generation relevant ones currently. We make sure more widgets will be supported in the future.<br> # Download and Installation {% hint style="info" %} We now provide a [**ShellAgent cloud version**](https://shellagent.myshell.ai) for all creators. Enjoy building your AI Agent online! {% endhint %} Download ShellAgent for local installation: <https://github.com/myshell-ai/ShellAgent/releases> <figure><img src="https://2975681513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDtmZwLatyyBFLUK6P6Pj%2Fuploads%2FchV0cXDaI5eA94nd7iUZ%2Fimage.png?alt=media&amp;token=f94a9f7a-e387-4d1a-a75f-8a80380d1996" alt=""><figcaption><p>ShellAgent cloud version</p></figcaption></figure> ## Download and install ShellAgent ### Install on Windows * After extracting the files, navigate to the main directory and double-click `run.bat`. This will automatically install the necessary dependencies. * Once you see the specified address in the command prompt, click `run.bat` again in the main directory. * Wait for the initialization to complete, then open your browser and go to <http://localhost:8099>. <figure><img src="https://2975681513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDtmZwLatyyBFLUK6P6Pj%2Fuploads%2F19pRSOVsPkMuH2dbnFMN%2Fimage.png?alt=media&amp;token=ef143c5a-80f2-4344-9926-0aacfd0c7605" alt="" width="563"><figcaption></figcaption></figure> ### Install on macOS or Linux * Extract the contents and enter the main directory. * Open a terminal and run the following commands: To install dependencies: `sh install.sh` <figure><img src="https://2975681513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDtmZwLatyyBFLUK6P6Pj%2Fuploads%2FbtHbe3dIm9cp7jTROtb6%2Fimage.png?alt=media&amp;token=460ec26e-507b-4ba8-b66b-6a0d008bcf27" alt="" width="375"><figcaption></figcaption></figure> To start the service: `sh start.sh` <figure><img src="https://2975681513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDtmZwLatyyBFLUK6P6Pj%2Fuploads%2FNLqGr3P1VFbcNNjVIen3%2Fimage.png?alt=media&amp;token=ecc90d8e-0ee9-4241-a251-d3c81d1b60cb" alt="" width="375"><figcaption></figcaption></figure> * Once the process is complete, visit <http://localhost:8099> in your browser. ### Update To enable automatic updates: * Go to **Settings** and turn on the auto-update option. * This ensures the application updates automatically every time you open it. <figure><img src="https://2975681513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDtmZwLatyyBFLUK6P6Pj%2Fuploads%2F37Mv8xjIYFKpUMSVDUgm%2Fimage.png?alt=media&amp;token=9b132970-f805-4c03-b2d2-52f0c541a344" alt="" width="563"><figcaption></figcaption></figure> If the auto-update option is unavailable, download the latest version of ShellAgent here. {% embed url="<https://github.com/myshell-ai/ShellAgent/releases>" %} ## Other preparation Visit the ComfyUI homepage to download and install [ComfyUI](https://github.com/comfyanonymous/ComfyUI). <figure><img src="https://2975681513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDtmZwLatyyBFLUK6P6Pj%2Fuploads%2FwiVM9QfGW5kgYuybbXW7%2Fimage.png?alt=media&amp;token=cbd47da3-0ec1-4cbb-9e31-420d8aed6c68" alt="" width="375"><figcaption></figcaption></figure> ## Setting Up the ShellAgent Plugin for ComfyUI There are two methods, as follows: 1. Download or `git clone` <https://github.com/myshell-ai/ComfyUI-ShellAgent-Plugin> repository content to the `ComfyUI/custom_nodes/` directory. 1. In the custom\_nodes directory, use the `git clone <https://github.com/myshell-ai/ComfyUI-ShellAgent-Plugin.git>` command to install 2. In the ShellAgent-Plugin directory, use `pip install -r requirements.txt` to install dependencies 2. Search for ShellAgent using ComfyUI-Manager, click to install 3. Restart ComfyUI, start building the workflow ## Notice Using ComfyUI Widget requires starting ComfyUI outside of ShellAgent. <figure><img src="https://2975681513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDtmZwLatyyBFLUK6P6Pj%2Fuploads%2FA36A4TAUOUl4baNg8vtP%2Fimage.png?alt=media&amp;token=62d2abe1-1e80-4e0d-9a3f-c646ae316674" alt="" width="563"><figcaption></figcaption></figure> Copy the ComfyUI service address to the settings in ShellAgent: <figure><img src="https://2975681513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDtmZwLatyyBFLUK6P6Pj%2Fuploads%2FSF3GfXltH1hHEzyT9bBm%2Fimage.png?alt=media&amp;token=5883ade7-6801-4b5e-b03f-d3f31703dc37" alt=""><figcaption><p>Copy and fill out in the Environment</p></figcaption></figure> <figure><img src="https://2975681513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDtmZwLatyyBFLUK6P6Pj%2Fuploads%2FhF7pamkl6Iuicj3jcfzN%2Fimage.png?alt=media&amp;token=934bd9a2-323e-4ec0-ab70-8f5b2968b523" alt=""><figcaption><p>Find your MyShell_api key here and fill it in</p></figcaption></figure> # App Builder ## Core Concepts of App Builder The core concept behind the App is a state machine integrated with tasks that can perform AI functions, transitioning between different states through user interactions. App Builder has significant differences from Workflow: 1. **Essence**: Workflow executes each node sequentially until a one-time completion, while the App can interact with users indefinitely without stopping, and developer can have full agency on setting the user journey. 2. **Editing Interface**: In Workflow, the connections between nodes represent data transmission; in the App, connections between widgets represent user interactions. The content of Workflow nodes is embeded within the nodes, while in the App, most of the widget content sourced from external forms. <figure><img src="https://2975681513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDtmZwLatyyBFLUK6P6Pj%2Fuploads%2FO3NWJ4gfakQhun1BRH5R%2Fimage.png?alt=media&amp;token=94cf0b97-e041-4617-90e8-1f63f6e860ac" alt=""><figcaption></figcaption></figure> <figure><img src="https://2975681513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDtmZwLatyyBFLUK6P6Pj%2Fuploads%2FvCUNtIvJqsaO7mkvlHtA%2Fimage.png?alt=media&amp;token=6a1efbd8-77ac-4029-b585-ae196bf74e7d" alt=""><figcaption><p><em>The above image is Workflow, the below image is App Builder</em></p></figcaption></figure> ### App State Machine Taking a chat agent as an example, generally speaking, in the App, a State corresponds to a reply message from the bot. Users can transition to different State through various actions such as text input, voice input,clicking buttons, or filling forms. Each State of the agent can run different AI modules (Tasks) based on the input, or collectively build the reply content (Message). It can also output some other results (Outputs) for use by other States. ## App Builder The App Builder is a no-code canvas-like editor where you set up States and connect Widgets to build your App.<br> <figure><img src="https://2975681513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDtmZwLatyyBFLUK6P6Pj%2Fuploads%2FPqJVsw8t9XYeY1hhDgQK%2Fimage.png?alt=media&amp;token=3da9cf96-27ca-436c-8d19-fc0e8ce64fa2" alt=""><figcaption></figcaption></figure> The left side includes two types of interactive entities: * **State**: Corresponds to a State in Pro Config editing mode, which can be dragged onto the canvas. * **Widget**: Corresponds to AnyWidgetModule in Pro Config editing mode, which can be dragged under a State's Task or added by clicking "Add" under Task. Currently, only the following two Widgets are supported, and we will soon support many more widgets in future updates: * **Workflow Runner Widget**: This Widget can execute a specified Workflow * **GPT Widget**: This Widget can call a specified GPT model ## Start Node You can set the Context; Variables under Context can be accessed by all States and can be modified by any State. For how to access them, please refer to [#using-variables](#using-variables "mention") in this chapter, and for how to modify them, please refer to [#modifying-context-variables](#modifying-context-variables "mention") in this chapter. {% hint style="info" %} **For developers who are familiar with Pro Config mode**: The Start state corresponds to Automata in ProConfig. However, Automata can set global transitions, which the current App Builder does not support. {% endhint %} ## State ### Input State Input has the same functionality as the Input of the Workflow Start node; it represents the parameters accepted by the current State. Just like in Workflow, an Input includes a name, type, and more advanced settings. <figure><img src="https://2975681513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDtmZwLatyyBFLUK6P6Pj%2Fuploads%2FegQJYyVKo0Aq8pjYXGoX%2Fimage.png?alt=media&amp;token=70177214-b05d-4ed4-b480-6f613f96ebbc" alt="" width="375"><figcaption></figcaption></figure> Compared to Workflow, it is more complex because Inputs have more sources: **User Input (User Input: True)**: This input is filled in by user. <figure><img src="https://2975681513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDtmZwLatyyBFLUK6P6Pj%2Fuploads%2FhK8xoCTtly5TDcwUi9Qu%2Fimage.png?alt=media&amp;token=21ddcc5a-baa4-4772-92b2-2dc864392f99" alt="" width="375"><figcaption></figcaption></figure> * **Form Input (Source: form)**: User fills in the input in a form that pops up when clicking a button. &#x20; <figure><img src="https://2975681513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDtmZwLatyyBFLUK6P6Pj%2Fuploads%2FICi3LeMsIgWV7f318RAR%2Fimage.png?alt=media&amp;token=11c82aca-1b31-409d-97eb-6d4db4bc23ab" alt="" width="375"><figcaption></figcaption></figure> <figure><img src="https://2975681513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDtmZwLatyyBFLUK6P6Pj%2Fuploads%2FzrFAFBU2m2fZQoU0RjeZ%2Fimage.png?alt=media&amp;token=783cc7f5-436e-4281-bcf2-975343beda39" alt="" width="375"><figcaption></figcaption></figure> * **Chat Input (Source: IM)**: User inputs in the chat input box. &#x20; <figure><img src="https://2975681513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDtmZwLatyyBFLUK6P6Pj%2Fuploads%2Fp49FV46OyusQ9Va9TgvD%2Fimage.png?alt=media&amp;token=f2c7585f-192c-4cd4-aff2-7889550948fa" alt="" width="375"><figcaption></figcaption></figure> <figure><img src="https://2975681513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDtmZwLatyyBFLUK6P6Pj%2Fuploads%2FRi6M9nER9TsV3ohDGVQU%2Fimage.png?alt=media&amp;token=baf72ca8-2117-4f5f-8a6e-a072fc780bec" alt="" width="375"><figcaption></figcaption></figure> **Non-user Input (User Input: False)**: This input is set by the developer. * **Transferred Input**: Other States assign values to this Input when transitioning to this State. * **Local Variables**: Variables that will be used by this State. {% hint style="info" %} To avoid unnecessary issues, we recommend that the User Inputs in a single State be either all form inputs or all IM inputs. {% endhint %} {% hint style="info" %} The State connected to the Start node is the initial state; the Input of the initial state will be ignored during the first run. You can create a greeting statement that does not require Input as the initial state, or set default values for Inputs to avoid errors caused by missing values. {% endhint %} ### Task A Task is a call to a Widget. After adding a Task, click its name to edit the corresponding configuration and see its returned data structure. <figure><img src="https://2975681513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDtmZwLatyyBFLUK6P6Pj%2Fuploads%2FRiYxs2LYKuVuLb67dsoK%2Fimage.png?alt=media&amp;token=4f091f5e-2c75-484c-9f0b-97901ba054c8" alt="" width="375"><figcaption></figcaption></figure> You can use the Task's name to reference its returned results. <figure><img src="https://2975681513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDtmZwLatyyBFLUK6P6Pj%2Fuploads%2F58Pqz0wDhz2FMypPej32%2Fimage.png?alt=media&amp;token=85db56ee-9704-4038-b741-920b9f1c3d7c" alt="" width="366"><figcaption></figcaption></figure> {% hint style="info" %} Tasks are executed sequentially; each Task can only reference the results of previously executed Tasks. {% endhint %} ### Output Output is mainly used to output variables for other States to use. Whenever certain data can be repeatedly used , such as Task execution results or user Inputs, you can set them as Outputs. Outputs can be created as new Output variables or by modifying existing Context variables. #### Creating a New Output Variable * Create a new Output variable <figure><img src="https://2975681513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDtmZwLatyyBFLUK6P6Pj%2Fuploads%2FKuwNF8tkXg8MH5LXkzvC%2Fimage.png?alt=media&amp;token=2a9e0b87-25ef-43ef-9e50-0f5a2dba42b9" alt="" width="365"><figcaption></figcaption></figure> * Edit its properties <figure><img src="https://2975681513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDtmZwLatyyBFLUK6P6Pj%2Fuploads%2FJrEegkXKvZRP52lAJ4dR%2Fimage.png?alt=media&amp;token=91ac8907-81ad-4b84-ae44-9ac8439ec095" alt="" width="353"><figcaption></figcaption></figure> * Modify the Variable Name and other properties, then confirm. <figure><img src="https://2975681513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDtmZwLatyyBFLUK6P6Pj%2Fuploads%2FLTYJ9dMTXeZCsTr5O0ye%2Fimage.png?alt=media&amp;token=9e54de46-48c9-48ad-855c-6e67418f8919" alt="" width="375"><figcaption></figcaption></figure> * Assign a value to the Output variable. The assignment method is the same as [#using-variables](#using-variables "mention"). <figure><img src="https://2975681513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDtmZwLatyyBFLUK6P6Pj%2Fuploads%2FxUfGPDEYf4tiqMGtiDzW%2Fimage.png?alt=media&amp;token=c01e1db2-a20b-40cc-9783-1be4393f1791" alt="" width="375"><figcaption></figcaption></figure> After creation, this Output can be referenced in other States. <figure><img src="https://2975681513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDtmZwLatyyBFLUK6P6Pj%2Fuploads%2FAb9Hn2dICT5hQHdE73nH%2Fimage.png?alt=media&amp;token=33a81b44-523c-4b6f-bca9-ceb6aba7070c" alt="" width="372"><figcaption></figcaption></figure> {% hint style="info" %} Note that any State can reference the Outputs of any other State, but there is no guarantee that the referenced State can be executed. Therefore, be mindful of the execution order of States when referencing. {% endhint %} #### Modifying Context Variables * Create a new Output variable <figure><img src="https://2975681513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDtmZwLatyyBFLUK6P6Pj%2Fuploads%2F7kD7nT5hFukM3bRW1w7F%2Fimage.png?alt=media&amp;token=2a2f6708-b669-4b63-a4e0-02bcb3a47a8d" alt="" width="365"><figcaption></figcaption></figure> * Edit its properties <figure><img src="https://2975681513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDtmZwLatyyBFLUK6P6Pj%2Fuploads%2FQiI82X9O7YCJdKVY48Fk%2Fimage.png?alt=media&amp;token=b8d61b75-b5be-497f-b4e1-8aee794b75a9" alt="" width="353"><figcaption></figcaption></figure> * Set Variable Name mode to Select Output <figure><img src="https://2975681513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDtmZwLatyyBFLUK6P6Pj%2Fuploads%2FOpQjvC7VTIUgVpPBXJIw%2Fimage.png?alt=media&amp;token=948f18bf-bea0-4d20-af22-9acaf1e386f6"
프로젝트로 돌아가기