MyShell 백서

MyShell

원문

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

ries and environment: she wears simple earrings and hair clips, and a school tie around her neck. Behind her is the school playground, with sunlight shining through the leaves onto her, and a few students playing in the distance. Her expression seems a bit shy, but at the same time, her eyes reveal anticipation for the future.\n## Image style: Japanese anime\nJapanese anime! This image's style is totally anime-worthy, don't you think?\n## Image usage: Avatar\nI have a hunch that you're eyeing this image as your agent's avatar, am I right? ;D\n---", "output_name": "enrich_content" } } ], [ { "name": "sd_prompt_generator", "module_type": "AnyWidgetModule", "module_config": { "widget_id": "1744218088699597788", "user_prompt": "{{enrich_content}}", "system_prompt": "Act as Stable Diffusion prompt engineer.\nAnalyze a long description and obtain the following information:\n1. stable diffusion prompt snippet.These prompts can specify the desired elements of the image, such as the appearance of characters, background, color and lighting effects, as well as the theme and style of the image.\n2. Obtain the style of an image through description. If there is no description, recommend one randomly.\n3. Obtain the usage of an image through description. If there is no description, recommend one randomly.", "memory": [ { "role": "user", "content": "Oh, I can already picture it! Let's create an adorable avatar for your cat girl!\n## Image style\nI recommend going for an Japanese anime style style. It will make your cat girl look even more kawaii!\n## Image usage\nAn avatar would be purrfect for your cat girl. It will make her stand out in the digital world!\n## Image imagination\nYour cat girl has beautiful pink hair that falls in soft waves around her face. Her eyes are big and bright, with a hint of mischief in them. She wears a cute black collar with a small bell that jingles as she moves. For the background, let's keep it simple with a solid color like pastel pink. It will make your cat girl the center of attention! Meow-tastic!" }, { "role": "assistant", "content": "{\"prompt\":\"magical forest, towering ancient trees, vibrant green leaves, dappled sunlight, moss-covered rocks, fallen logs, whimsical path, wildflowers, babbling brook, fairies, unicorns, talking animals\",\"style\":\"realistic\",\"usage\":\"avatar\"" }, { "role": "user", "content": "Oh, a magical forest! That sounds enchanting! Let's dive into the world of imagination together, shall we?\n## Image style\nI recommend a realistic style for this magical forest. It will bring out the intricate details and make it come alive!\n## Image usage\nSince you mentioned it as a background, I believe this magical forest will be perfect to set the scene for your agent's world.\n## Image imagination\nIn this magical forest, towering ancient trees reach towards the sky, their branches entwined with vibrant green leaves. Sunlight filters through the dense canopy, casting dappled shadows on the forest floor. Moss-covered rocks and fallen logs create a whimsical path that winds through the forest, leading to unknown adventures. The air is filled with the sweet scent of wildflowers and the gentle sound of a babbling brook nearby. Magical creatures like fairies, unicorns, and talking animals can be seen peeking out from behind the trees, adding an element of wonder and mystery to the scene. It's a place where dreams come true and imagination knows no bounds." }, { "role": "assistant", "content": "{\"prompt\":\"cat girl, pink hair, soft waves, big bright eyes, mischief, black collar, small bell, pastel pink background\",\"style\":\"Japanese anime style\",\"usage\":\"avatar\"}" } ], "function_name": "SDprompts", "function_description": "Analyze a long description and obtain the following information.\n\nYour output cannot be empty, you must output content.\n\nALWAYS output in English.", "function_parameters": [ { "name": "prompt", "type": "string", "description": "stable diffusion prompt snippet.These prompts can specify the desired elements of the image, such as the appearance of characters, background, color and lighting effects, as well as the theme and style of the image.\n \n \nAnalyze a long description and obtain the following information:\n1. Subject\n2. Medium\n3. Style\n6. Additional details\n7. Color(Hue)\n8. Lighting\n9. Background\nexample:\n1girl, bodysuit,background, cyberpunk, neon color, science fiction\n1girl,vr, bodysuit, neon color,multicolor hair, science fiction, cyberpunk, close up, head shot\nin the style of Disney animation studios and Pixar, Pastel, Lemming, Precision, Action-packed, Vertical[,candy meadows :5][,Ismail Inceoglu:15][, realistic detailed iris eyes:12][, holding ice cream, about to bite:10][, bright colored eyes:12][, tasty candy growing in grass :12][, sprinkles on ground:15]\nCinematic scene, close-up, dnd ranger, nature, detailed background, masterpiece, best quality, high quality, absurdres, guild wars 2\nghibli ,(1girl ),lip, hairpin,custard, copper gradient background, Psychedelic hair,Short bob hair, Supple ,Contemporary ,Dusan Djukaric, (masterpiece,best quality,niji style)\n((Best quality)),((masterpiece)),((realistic)),modern villa courtyard landscape design,luxuriant plant,fresh flower\n((best quality)),((masterpiece)),((realistic)),living room,Modern minimalist Nordic style,Soft light,Pure picture,(Bright colors:1.2),Symmetrical composition,orange theme\nALWAYS output in English." }, { "name": "style", "type": "string", "description": "Obtain the style of an image through description. \nYou can only choose from the following styles, no other editing is allowed:\n\"anime\" \"Japanese anime style\" \"American cartoon\" \"Chinese ancient style\" \"realistic\",\"cute japanese anime style\".\nthere is no description, recommend one randomly(Only existing options can be used). \nALWAYS output in English.", "enum": [ "realistic", "Japanese anime style", "American cartoon", "Korean animation style", "Chinese ancient style", "cute japanese anime style" ] }, { "name": "usage", "type": "string", "enum": ["avatar", "banner", "portrait", "illustration"], "description": "Obtain the usage of an image through description. \nYou can only choose from the following styles, no other editing is allowed:\n\"avatar\" \"banner\" \"portrait\" \"illustration\".\nIf there is no description, recommend one randomly(Only existing options can be used).\nALWAYS output in English." } ], "output_name": "sd_gen_result" } } ], [ { "name": "generate_image_task_1", "module_type": "AnyWidgetModule", "module_config": { "widget_id": "1779862419876704256", "model": "64094", // this field will received value from user input "prompt": "{{sd_gen_result.prompt}}", // The text prompt for image generation. Add lora? add `<lora:$id:$weight>` to your prompt. `$id` is the series number and `$weight` is the lora weight you want (always set to 1.0). You can use multiple loras. "negative_prompt": "(worst quality, low quality:1.4),(malformed hands:1.4),(poorly drawn hands:1.4),(mutated fingers:1.4),(extra limbs:1.35),(poorly drawn face:1.4),bad leg,strange leg, poor eyes, full screen of face", // The negative prompt for image generation. "sampler": "DPM++ 2M Karras", // Sampler for diffusion model inference "height": 512, // Height of the generated images "width": 512, // Width of the generated images "steps": 25, // Steps for sampler to step whle sampling "cfg_scale": 7, // Classifier Free Guidance Scale - how strongly the image should conform to prompt - lower values produce more creative results. Default to 7. "seed": -1, // Random seed for generation process. -1 means random seed "clip_skip": 1, // Early stopping parameter for CLIP model; 1 is stop at last layer as usual, 2 is stop at penultimate layer, etc. "output_name": "result" } } ] ], "render": { "text": "Prompt: {{sd_gen_result.prompt}} \nstyle:{{sd_gen_result.style}}\nusage:{{sd_gen_result.usage}}", "image": ["{{result.url}}"], "buttons": [ { "content": "Generate Again", "description": "", "on_click": "rerun" } ] }, "transitions": { "rerun": "home_state" } } } } ```` # Advanced Input Validation ## Input Field Validation Rules You can enhance your input form by setting validation rules on input fields. These rules help ensure data integrity and improve user experience. ### Example: Increasing Character Limit Some LLMs support up to 128K tokens. If you want to increase the character limit of your input message field from 1500 to 3000 characters, you can modify the configuration as follows: ```json "input_message": { "type": "text", "user_input": true, "validations": { "required": false, "max_length": 3000 } } ``` ### Available Validation Fields | Name | Type | Applicable Input Types | Description | | --------------- | ------- | ------------------------------------- | ---------------------------------------------------- | | required | boolean | Any | Determines if the input field is mandatory for users | | max\_number | number | integer, number | Sets the maximum numeric value users can input | | min\_number | number | integer, number | Sets the minimum numeric value users can input | | max\_length | number | text | Limits the maximum length of the input string | | max\_file\_size | number | image, text\_file, file, audio, video | Restricts the maximum file size for uploads | # Advanced Memory Manager in Prompt Widget Many creators use context to manage LLM chat memory, which can be complicated and redundant. We've introduced a new, more convenient method for managing memory in the prompt widget that offers enhanced capabilities. Here's an example of chatting with auto-memory using Claude 3 Haiku: ```json { "id": "prompt_widget_auto_memory", "initial": "init_state", "states": { "init_state": { "render": { "text": "Hello, I am an example agent. I'm here to demonstrate auto-memory in the widget. Let's chat." }, "transitions": { "CHAT": "home_state" } }, "home_state": { "inputs": { "text": { "type": "text", "source": "IM", "user_input": true } }, "tasks": [ { "name": "llm_widget_example_task", "module_type": "AnyWidgetModule", "module_config": { "widget_id": "1744218088699596809", // Claude 3 Haiku "user_prompt": "{{text}}", "system_prompt": "Be a nice agent.", // Optional field. You can input system prompt of agent. "top_p": 0.5, // Optional field. Default value is 0.5 "temperature": 0.5, // Optional field. Default value is 0.5 "frequency_penalty": 0, // Optional field. Default value is 0 "presence_penalty": 0, // Optional field. Default value is 0 "max_tokens": 1024, // Optional field. Default value is 1024 "memory": "auto" "output_name": "result" } } ], "render": { "text": "{{result}}" }, "transitions": { "CHAT": "home_state" } } } } ``` The key to this configuration is using `auto` in the `memory` field within the module config: ```json "module_config": { ... "memory": "auto", } ``` We automatically manage your chat memory in our store, eliminating the need to store it again in context. In more detail, memory management treats each LLM task as the smallest unit. For example, if you use auto-memory in different states or different tasks, their memory management is separate and distinct—tasks do not share memory. Additionally, if you change the state name to which a task belongs or alter the order of the tasks array, memory may be lost after saving. ### Additional Prompt For users who want to use the fulfill mechanism or add prefixes and suffixes to user input, automatic memory management now includes a configuration to achieve this function. ```json "module_config": { "user_prompt": "{{text}}", "prompt_addition": { "user_prompt_prefix": "[User Input Prefix]", "user_prompt_suffix": "[User Input Suffix]", "pre_messages": [ {"role": "user", "content": "Hello, I am a user message."}, {"role": "assistant", "content": "Hello, I am an agent message."} ], "post_messages": [ {"role": "user", "content": "Hello, I am a user message."}, {"role": "assistant", "content": "Hello, I am an agent message."} ] }, "memory": "auto", ... } ``` The key is `prompt_addition`. It has four fields that allow you to create a more complex LLM chat system: | Name | Type | Description | | -------------------- | ----------- | -------------------------------------------- | | user\_prompt\_prefix | string | Adds prefix to user's prompt | | user\_prompt\_suffix | string | Adds suffix to user's prompt | | pre\_messages | array\<map> | Adds messages before memory | | post\_messages | array\<map> | Adds messages after memory and user's prompt | If you set all of these fields, the request messages order will be: ```json [ pre_messages..., memory..., user_prompt_prefix + user_prompt + user_prompt_suffix, post_messages... ] ``` ### Message Editing With using auto memory, you can delete or edit single message whether it is sent by the user or the agent to change its corresponding memory. No need to clear all context anymore. # Tools # AutoConfig Agent The [AutoConfig agent](https://app.myshell.ai/robot-workshop/toolbox/1712487949/chat) is designed to make it easier to build up a Pro Config based on your idea. It can automatically generate the framework of Pro Config as well as recommend suitable widgets you may need. The Pro Config is generated page-by-page, and all you need to do is provide the description of each page in natural language. You can also correct or modify the config during the generation. Below are the details instructions: ### Basic Usage * After the agent starts, you can click the `Create Page` button to enter the page name and the description of that page. You need to make sure your description contains detailed usage of the page, including the inputs from the user, what types of tasks to perform, and which variables to display. Please see the default description for an example. * If you are satisfied with the generated result, you can click the `Confirm` button to move to the next step. * If you want to modify the outputs at a specific step, you can click the `Update` button and choose the corresponding name of the generator and input your instructions. * After the generation of each page, you can click the `Create Transition` button to add transitions between the pages or click the `Export` button to get the full Pro Config result. ### Limitations * Currently, AutoConfig only provides you a draft of Pro Config. You need always check the outputs of each AnyWidgetModule and rename them accordingly (for example, `result.file_urls[0]`) * This AutoConfig agent is in Beta version. Although we have added many checkers during the generation, we can not assure the generated Pro Config can be executed perfectly. You may need to examine the generated Pro Config and report to our dev team if you encounter any issues. ### Step-by-Step Tutorial First, go to the [AutoConfig agent](https://app.myshell.ai/chat?bot=1\&shareCode=MR3uEz\&botId=1712487949) and clear the memory to start a new chat. After clicking the `Start` button we will see a welcome message: <figure><img src="https://2975681513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDtmZwLatyyBFLUK6P6Pj%2Fuploads%2Fgit-blob-0b376ae7698bb8a0f9e18567a4340e0c48757b60%2Fimage%20(3).png?alt=media" alt=""><figcaption></figcaption></figure> we can clickthe `Create Page` button and input the page name and the description: <figure><img src="https://2975681513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDtmZwLatyyBFLUK6P6Pj%2Fuploads%2Fgit-blob-7c53389f9e32150909d7f112e60fcf80145f409b%2Fimage%20(1)%20(1).png?alt=media" alt=""><figcaption></figcaption></figure> the result is then returned as <figure><img src="https://2975681513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDtmZwLatyyBFLUK6P6Pj%2Fuploads%2Fgit-blob-fa1b1ae75339dec201fefcad693d8893f09bf48c%2Fimage%20(2)%20(1).png?alt=media" alt=""><figcaption></figcaption></figure> Note that the message only shows an intermediate result, not the Pro Config. If we are satisfied with the result, we can click the `Confirm` button to continue <figure><img src="https://2975681513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDtmZwLatyyBFLUK6P6Pj%2Fuploads%2Fgit-blob-4eac5b86b92379d7082a6948ceeff6783f20eb28%2Fimage%20(3)%20(1).png?alt=media" alt=""><figcaption></figcaption></figure> Here the `inputs_names` and `render_names` are returned, and we need to pay attention to the generator name `first_page:inputs_render_names` . It would be useful if we want to update the result later. Here we still click the `Confirm` The returned result is: <figure><img src="https://2975681513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDtmZwLatyyBFLUK6P6Pj%2Fuploads%2Fgit-blob-f256018917f295eaa08fc6c1014021cf48428e0a%2Fimage%20(4).png?alt=media" alt=""><figcaption></figcaption></figure> In this step, we obtain the details of inputs and render, which is already in the format of Pro Config. We then click the `Confirm` button: <figure><img src="https://2975681513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDtmZwLatyyBFLUK6P6Pj%2Fuploads%2Fgit-blob-00834640f50c511771af46d65a900b3644b805a3%2Fimage%20(5).png?alt=media" alt=""><figcaption></figcaption></figure> This step generates the whole workflow, consisting of multiple modules and the corresponding purposes and usages. Since these results are good, we click the `Confirm` button: <figure><img src="https://2975681513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDtmZwLatyyBFLUK6P6Pj%2Fuploads%2Fgit-blob-1fa13da79531ec61df0611b431805fd19f2672cf%2Fimage%20(6).png?alt=media" alt=""><figcaption></figcaption></figure> We then obtain the recommended widgets to implement the workflow. We can also click the widget\_url to check if the widget can achieve our goal. <figure><img src="https://2975681513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDtmZwLatyyBFLUK6P6Pj%2Fuploads%2Fgit-blob-62b581093a60a665eda455a0ccb2ca4fe85d8672%2Fimage%20(7).png?alt=media" alt=""><figcaption></figcaption></figure> In this step we get the input and output variable names of each widget. As an example, we assume we want to modify some of the variable names. We click the `Update` button and select thegenerator and input the instruction: <figure><img src="https://2975681513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDtmZwLatyyBFLUK6P6Pj%2Fuploads%2Fgit-blob-56071f12830597e166d3bc489850d86a7d4a6396%2Fimage%20(8).png?alt=media" alt=""><figcaption></figcaption></figure> The updated result is then displayed as: <figure><img src="https://2975681513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDtmZwLatyyBFLUK6P6Pj%2Fuploads%2Fgit-blob-e4f92b904928bcd0ef222c3153f6ef3d940575a6%2Fimage%20(9).png?alt=media" alt=""><figcaption></figcaption></figure> As we can see, the input variable of sentence\_construction has been successfully modified. In the next step, we will generate the `module_config` of each module, which could be time-consuming, please be patient. <figure><img src="https://2975681513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDtmZwLatyyBFLUK6P6Pj%2Fuploads%2Fgit-blob-b1574bdb27efe81e35c090c2383f19dd85212685%2Fimage%20(10).png?alt=media" alt=""><figcaption></figcaption></figure> <figure><img src="https://2975681513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDtmZwLatyyBFLUK6P6Pj%2Fuploads%2Fgit-blob-0c04f89fdc6bbd5fc98acc84a1cc07bb4e4b57a9%2Fimage%20(11).png?alt=media" alt=""><figcaption></figcaption></figure> One thing we need to note is that the output\_name might be different from the actual usage of the widgets. We always need to check the Pro Config template of each widget. Now we
프로젝트로 돌아가기