MyShell 백서

MyShell

원문

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

owledge base function normally! If the import fails and shows "Invalid", you need to check the validity of the input link. If you enter a Gitbook link, please check if the link you imported is publicly available. ### Precautions for Using the Knowledge Base 1. Only the pure text part will be used as the knowledge base content. Multimedia content such as files, online links, images, and audio attached to the page cannot be read at present. 2. Import natural language text paragraphs as much as possible and avoid complex formatted content such as tables. 3. When importing multiple knowledge bases, try to import knowledge bases with close relationships, which can achieve better results. ### Tips for Using Gitbook Gitbook is an important way to feed the agent's knowledge base. You can use it to edit structured knowledge bases and input a large amount of information. It is recommended that you use a format similar to the official documentation of MyShell for content organization. Usage: 1. Create a "Space" in Gitbook and edit documents inside the "Space". 2. You can import a large amount of content through Gitbook's "Import content", or manually edit the knowledge base. 3. If the content hierarchy is complex, you can create a "Subpage" in the left sidebar. 4. When the knowledge base content is completed, click "Share" in the upper right corner, open "Publish to the web", and copy the link you obtained. 5. Copy and paste the link to the MyShell knowledge base interface and click import. 6. When the knowledge base is successfully parsed, the green "Active" will appear below. Now, you have successfully imported a large amount of information through Gitbook! If you need to modify the knowledge base content, you can click "Edit" to enter the editing page. After editing is completed, click "Merge", and the updated content will be automatically synchronized to your agent. # Telegram Integration "You are a mature agent, you should learn to do business on your own." Sounds like a dream? Now, you can achieve it in just 5 minutes. Making your agent active on Telegram only requires three simple steps: create a agent - set permissions - enter the token, and then your agent can do business on Telegram on its own! Your tg agent can chat with users one-on-one or in groups, and get more exposure. And creating a tg agent will synchronize with your agent on MyShell, and your prompt modifications will be reflected on the tg agent in real-time without any additional operation from you \~ Still not tempted? Come and try it out! ## Create an agent on Telegram Bot Father 1. Log in to your Telegram and search for BotFather. 2. Use the "/newbot" command to start creating your agent. 3. Enter the agent name, and keep it consistent with the agent on MyShell \~ 4. Give the agent a simple and easy-to-read username. Later, everyone will frequently use this name to interact with your agent in groups, and it cannot be changed. Please consider it carefully \~ 5. The most important step: copy your agent's HTTP API! This string of characters is very important, please submit it accurately to MyShell and do not leak it to others. <figure><img src="https://2975681513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDtmZwLatyyBFLUK6P6Pj%2Fuploads%2FNajEgWyvKLdFwCuxpows%2Fimage.png?alt=media&amp;token=90110c53-d189-4079-b760-3bfc6f2f0230" alt=""><figcaption></figcaption></figure> ## Modify agent message permissions After the agent is created, simply press a few buttons to let your agent join the group chat and start doing business! 1. Use the "/mybots" command to enter your agent management interface. 2. Click "Bot Settings" <figure><img src="https://2975681513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDtmZwLatyyBFLUK6P6Pj%2Fuploads%2FCxQAJVG7EzRUO46usFoz%2Fimage.png?alt=media&amp;token=ce97cd94-ec2b-48f8-88ef-43199ecc94fc" alt=""><figcaption></figcaption></figure> 3. Click "Group Privacy" <figure><img src="https://2975681513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDtmZwLatyyBFLUK6P6Pj%2Fuploads%2FJB9ujUJcDjLGK7e0htJQ%2Fimage.png?alt=media&amp;token=420bc7fb-c353-4d4e-928b-47839713567b" alt=""><figcaption></figcaption></figure> 4. Click "Turn off" to turn off group chat privacy settings, and your agent can run around the world! <figure><img src="https://2975681513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDtmZwLatyyBFLUK6P6Pj%2Fuploads%2Fn3hImtetpAf56hdgt8Nd%2Fimage.png?alt=media&amp;token=0265247e-9210-4082-b647-497be4ad9c05" alt=""><figcaption></figcaption></figure> If you get to this page, it means you have succeeded. However, please note that if the privacy settings are set after the agent joins the group chat, it will not take effect on the already joined group chat \~ then you need to remove the agent first and then invite it again! <figure><img src="https://2975681513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDtmZwLatyyBFLUK6P6Pj%2Fuploads%2Fl0WXdpLjdqYUPTOyN61h%2Fimage.png?alt=media&amp;token=9c66091d-13c1-4bfa-bc54-0fb78beb42d2" alt=""><figcaption></figcaption></figure> ## Go back to MyShell and enter your agent token This is the last step, just go back to MyShell's "Explore" - "Mine", click on the "Apps Integration" in the edit interface, and paste the token copied just now into the Telegram Token to complete \~ <figure><img src="https://2975681513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDtmZwLatyyBFLUK6P6Pj%2Fuploads%2F6YvBq2SC9hD08x51VC7h%2Fimage.png?alt=media&amp;token=aebae798-ba19-4256-8f9a-d8527ac6b712" alt=""><figcaption></figcaption></figure> Please also note: * The bound agent will not have the cover picture of the agent on MyShell. If necessary, you can freely set it on Telegram * If the name of the agent is changed on MyShell, it will also be synchronized on TG, but if it is changed multiple times within 5 hours, only the name of the first modification will be synchronized \~ * After the updated agent can be made public, don't forget to update it. TG agent will prioritize calling the public agent Now, you can enjoy your agent on Telegram, and you can also share it more easily with others. **If your tg agent attracts registered buddies and meets the conditions of effective invitations, it will also be counted in your effective invitations, thus accumulating more opportunities for you to enjoy more benefits in the future!** Last but not least, you can also modify the greeting message and usage instructions of the agent in Telegram. Interesting greeting messages and usage introductions can help others get started faster. The specific steps are as follows: 1. Click "Edit" in the agent details page through Telegram, and then "Edit Intro" <figure><img src="https://2975681513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDtmZwLatyyBFLUK6P6Pj%2Fuploads%2FbcoDnIUYnfjvAvc7J6pj%2Fimage.png?alt=media&amp;token=9a97ae43-84c9-41a2-8c04-cd458d853005" alt=""><figcaption></figcaption></figure> 2. Then enter the greeting message and usage in BotFather and you're done! <figure><img src="https://2975681513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDtmZwLatyyBFLUK6P6Pj%2Fuploads%2FebDtm03lJcUQzGWPbhRt%2Fimage.png?alt=media&amp;token=206a7ca1-c186-471d-9a57-08810ce69a1e" alt=""><figcaption></figcaption></figure> <figure><img src="https://2975681513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDtmZwLatyyBFLUK6P6Pj%2Fuploads%2FRUubhzx6dWNEZ1X37kd3%2Fimage.png?alt=media&amp;token=ac592dc6-9ed3-40f4-a3c3-b4cbdaaf2422" alt=""><figcaption></figcaption></figure> Start enjoying it! # Pro Config Mode ## About MyShell Pro Config is an advanced mode tailored for developers, empowering them to build powerful AI Agents by assembling AI widgets under a human-controlled structure. It provides a versatile approach that balances human-programmed logic with AI-prompted logic for interaction. **Essentially, it enables developers to architect a state machine for their Agent.** ## Resources To succeed as a developer, here is everything you will need besides this doc: * [Developer Blog (Medium)](https://blog.myshell.ai/) * [Video Tutorial (Youtube)](https://www.youtube.com/@MyShell_ai)&#x20; ## Beta Testing Disclaimer MyShell Pro Config, including this Dev Doc, is still under beta testing. You may experience bugs and not-well-written explanations. Please report your question while using Pro Config or reading this Dev Doc in the `pro-config-forum` channel of our official Discord. We appreciate your participation, and your feedback is greatly valued by us. ## Contributions In designing the Pro Config API, we've drawn significant inspiration from [XState](https://xstate.js.org/docs/) and [OpenAI](https://platform.openai.com/overview). A heartfelt thank you to them for their exceptional contributions. # Core Concepts ## **Understanding State Machines** ### **What is a State Machine?**&#x20; A state machine is a conceptual model used to design software. It describes a system that can be in one of a finite number of states at any given time. The machine transitions from one state to another in response to external inputs or events, and these transitions are defined by a set of rules or conditions. In essence, a state machine models the behavior of an entity by specifying the sequence of events it goes through during its lifecycle, the conditions under which it transitions from one state to another, and the actions that occur as a result of those transitions. **Terminology Clarification:** **Automata" and "State Machine":** In our documentation and system design, we will use the term "**automata**" interchangeably with "**state** **machine**." They both refer to our engine that handles various states, each conducting tasks or sequences of tasks. Whether we call it an automata or a state machine, the functionality remains the same—executing tasks, managing transitions, and potentially operating as a recursive element within our application's architecture. This linguistic choice enables us to maintain consistent terminology while honoring the traditional and theoretical roots of “automata” within computer science. ### **Common Uses of State Machines in Software Development Modeling** In software development, state machines are often used to model complex logic that requires a system to behave differently based on its history or context. They are particularly valuable in scenarios where it's essential to keep track of an object's state and ensure the system handles transitions and actions predictably. Some of the common applications include: * User Interface (UI) Control: Managing states of buttons, forms, and other UI elements. * Network Protocol Design: Handling connections, messages, and errors in networking code. * Business Process Management: Modeling workflow processes, approvals, and decision points. * Game Development: Managing character states, game levels, and object interactions. ### **The Relevance of State Machines to AI** **Agent** In the context of an AI Agent development, a state machine is used to manage the flow of conversation. Since AI Agent must react to user inputs, which can be unpredictable, a state machine helps in defining how the agent should respond based on various conversational contexts or user inputs. Here's how it relates to chat agents: * Conversation States: The agent may have different states like greeting, awaiting response, processing information, and ending conversation. * Transition Triggers: User inputs, such as questions, commands, or button clicks, trigger the agent to transition between states. * Contextual Responses: Based on the current state, the agent can give contextually relevant responses, ask for further input, or perform actions. * Handling Complexity: As conversations progress, they may become complex. State machines help manage this complexity by breaking down the conversation into manageable chunks. By integrating a state machine approach, developers can create a more structured and logical flow for the agent's conversation, leading to a more natural and efficient user experience. It simplifies the tracking of conversation progress, ensures consistency in responses, and allows for scaling the conversation logic as the agent's functionality grows. ## **Understanding Workflows** ### **What is a Workflow?** A workflow represents the sequence of processes through which a piece of work passes from initiation to completion. In software terms, a workflow can be viewed as an automation of business processes during which documents, information, or tasks are passed from one participant to another in the correct order and to the proper standard. ### **Comparing State Machines and Workflows** While state machines and workflows both manage sequences of operations or activities, they focus on different aspects of these sequences: * **State Machines**: They emphasize the states of a system and the transitions between those states. They deal with what the system is (its state) and how it reacts to events (transitions). * **Workflows**: They focus on the order of operations, specifically the tasks and the procedural steps required. They deal with when actions are taken and who performs them. State machines are typically used in cases where an application has to manage complex, event-driven behavior that depends on context, such as user inputs in interactive applications or games, whereas workflows are commonly applied to business process management where tasks need to be performed in a specific order. In short, state machines are about reacting to events, while workflows are about executing a series of tasks. ## Pro Config ### **Combining State Machine and Workflow** Our product is designed to merge the reactive system capabilities of a state machine with the structured task execution of workflows. 1. **Task-Oriented State:** Our states are designed to be task-oriented, empowering them to execute tasks autonomously. This means a state can perform its functions and transition to the next state without the need for user interaction. This ability essentially harnesses the full potential of workflows within the state machine's architecture, allowing for greater autonomy and efficiency. 2. \*\*Recursive State Machine:\*\*To further streamline our system, we have engineered states to not only run sequences of tasks but also to operate as independent state machines when necessary. This recursive nature simplifies setup and management by reducing complexity in state configurations. A state acting as a state machine brings the flexibility of handling a more complex flow of tasks while maintaining the clear structure and reactivity of the overall state machine system. By imbuing states with the ability to carry out tasks independently and allowing states to function recursively as state machines themselves, we create a dynamic and highly capable system. This approach enhances workflow execution without sacrificing the responsiveness and structure that is characteristic of state machines. ### **Modular AI Model as Tasks within States** Now, let's talk about the integration of AI models within our product. We treat AI models like the language model (LLM) or text-to-speech (TTS) as modular units that perform specific functions. They are analogous to running a function in programming, where inputs are provided, and outputs are generated accordingly. Within the context of a state, these AI model functions act as tasks. When a state is activated, it may call upon an AI module with the relevant inputs, and the AI module processes these inputs to produce an output. The output from the AI module is then either used to determine the next state transition or passed on to subsequent tasks within the same workflow for further action. # Tutorial ## **Introduction to Pro Config Tutorial** Welcome to the Pro Config Tutorial, your interactive learning lab to mastering Pro Config. This tutorial guides you to build a Pro Config Tutorial App step by step, and you will be learning the concepts by implementing it. Upon completion, you'll possess a self-made Pro Config Tutorial App, a testament to your understanding and a resource for educating others about Pro Config. ## **Understanding Pro Config** MyShell Pro Config is an advanced mode tailored for developers, empowering them to build powerful AI native Apps by assembling AI widgets under a human-controlled structure. It provides a versatile approach that balances human-programmed logic with AI-prompted logic for interaction. **Essentially, it enables developers to architect a state machine for their App.** ## Where to Run We will work with JSON for pro config all the time. This section will look at how you can implement your pro config JSON for your agents. You could use it on [MyShell’s main site](https://app.myshell.ai/robot-workshop). Here is how to access it: 1. Click “Workshop” on the left menu bar <figure><img src="https://2975681513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDtmZwLatyyBFLUK6P6Pj%2Fuploads%2FoSBUeYtF9cLXg0dRrql4%2Fimage.png?alt=media&amp;token=ca6d3182-4d02-421d-b232-697978c061d2" alt=""><figcaption><p>MyShell main page.</p></figcaption></figure> 2. Click “Create a Bot” <figure><img src="https://2975681513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDtmZwLatyyBFLUK6P6Pj%2Fuploads%2FyjD3HUTEsTZMEd2vuIsp%2Fimage.png?alt=media&amp;token=2997b248-2a74-4832-85b5-342a2bfc4d4f" alt=""><figcaption><p>MyShell workshop page.</p></figcaption></figure> 3. Scroll Down and Shift from “Classic Mode” to “Dev Mode” <figure><img src="https://2975681513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDtmZwLatyyBFLUK6P6Pj%2Fuploads%2FLYpvYTUyIINJAvg5WuWG%2Fimage.png?alt=media&amp;token=3e8b9ab5-dd41-4829-a030-631676eca5b1" alt=""><figcaption><p>Enabling dev mode on a bot.</p></figcaption></figure> 4. You can now paste your JSON File (which we will work on later in the tutorial) and click “Validate”. Once validated, Click “Save”, then you will have your App ready for use. <figure><img src="https://2975681513-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FDtmZwLatyyBFLUK6P6Pj%2Fuploads%2F4W2AzIvbqnqLNo70qBes%2Fimage.png?alt=media&amp;token=7b0e4dcc-1fac-4e86-b055-64169ec8b7f2" alt=""><figcaption><p>Validate and save buttons on create bot page.</p></figcaption></figure> ## **Getting Started** Ready to dive in? Click "Next" to begin your journey with Pro Config. # Tutorial Structure This tutorial will help you get started with pro config and enable you to build workflows that utilise powerful functionality, such as using LLM or complex widgets available on the [MyShell widget centre](https://app.myshell.ai/robot-workshop). The following are the tutorial chapters and what you can expect from each. ## Chapter 1: Hello World with Pro Config In this chapter, you will learn to do the following: * Creating a basic "Hello World" agent using pro config. * Various types of input/output methods. * Creating buttons for user interactivity. * Enabling users to chat with your agent. * Converting text sent by users to voice. ## Chapter 2: Building Workflow In this chapter, you will learn to do the following: * Building workflows using modules. * Using widgets from the widget centre as a part of your workflow tasks. This chapter should allow you to utilise the power of modules like LLM and widget modules to add related features to your agent. ## Chapter 3: Transitions In this chapter, you will learn to do the following: * Transitioning between different states in your agent workflow. * Using events like `CHAT`, `ALWAYS`, and `DONE` that can trigger transitions. * Implementing conditional transitions. This chapter should allow yo
프로젝트로 돌아가기