You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: generators/generator-botbuilder/README.md
+10-50Lines changed: 10 additions & 50 deletions
Original file line number
Diff line number
Diff line change
@@ -14,15 +14,13 @@ The generator supports three different template options. The table below can he
14
14
| Template | Description |
15
15
| ---------- | --------- |
16
16
| Echo Bot | A good template if you want a little more than "Hello World!", but not much more. This template handles the very basics of sending messages to a bot, and having the bot process the messages by repeating them back to the user. This template produces a bot that simply "echoes" back to the user anything the user says to the bot. |
17
-
| Core Bot | Our most advanced template, the Core template provides 6 core features every bot is likely to have. This template covers the core features of a Conversational-AI bot using [LUIS](https://www.luis.ai). See the **Core Bot Features** table below for more details. |
18
17
| Empty Bot | A good template if you are familiar with Bot Framework v4, and simply want a basic skeleton project. Also a good option if you want to take sample code from the documentation and paste it into a minimal bot in order to learn. |
19
18
20
19
### How to Choose a Template
21
20
22
21
| Template | When This Template is a Good Choice |
23
22
| -------- | -------- |
24
23
| Echo Bot | You are new to Bot Framework v4 and want a working bot with minimal features. |
25
-
| Core Bot | You understand some of the core concepts of Bot Framework v4 and are beyond the concepts introduced in the Echo Bot template. You're familiar with or are ready to learn concepts such as language understanding using LUIS, managing multi-turn conversations with Dialogs, handling user initiated Dialog interruptions, and using Adaptive Cards to welcome your users. |
26
24
| Empty Bot | You are a seasoned Bot Framework v4 developer. You've built bots before, and want the minimum skeleton of a bot. |
27
25
28
26
### Template Overview
@@ -31,38 +29,18 @@ The generator supports three different template options. The table below can he
31
29
32
30
The Echo Bot template is slightly more than the a classic "Hello World!" example, but not by much. This template shows the basic structure of a bot, how a bot recieves messages from a user, and how a bot sends messages to a user. The bot will "echo" back to the user, what the user says to the bot. It is a good choice for first time, new to Bot Framework v4 developers.
33
31
34
-
#### Core Bot Template
35
-
36
-
The Core Bot template consists of set of core features most every bot is likely to have. Building off of the core message processing features found in the Echo Bot template, this template adds a number of more sophisticated features. The table below lists these features and provides links to additional documentation.
37
-
38
-
| Core Bot Features | Description |
39
-
| ------------------ | ----------- |
40
-
|[Send and receive messages](https://docs.microsoft.com/azure/bot-service/bot-builder-howto-send-messages?view=azure-bot-service-4.0&tabs=javascript)| The primary way your bot will communicate with users, and likewise receive communication, is through message activities. Some messages may simply consist of plain text, while others may contain richer content such as cards or attachments. |
41
-
|[Proactive messaging](https://docs.microsoft.com/en-us/azure/bot-service/bot-builder-howto-proactive-message?view=azure-bot-service-4.0) using [Adaptive Cards](https://docs.microsoft.com/azure/bot-service/bot-builder-send-welcome-message?view=azure-bot-service-4.0?#using-adaptive-card-greeting)| The primary goal when creating any bot is to engage your user in a meaningful conversation. One of the best ways to achieve this goal is to ensure that from the moment a user first connects to your bot, they understand your bot’s main purpose and capabilities. We refer to this as "welcoming the user." The Core template uses an [Adaptive Card](http://adaptivecards.io) to implement this behavior. |
42
-
|[Language understanding using LUIS](https://docs.microsoft.com/azure/bot-service/bot-builder-howto-v4-luis?view=azure-bot-service-4.0)| The ability to understand what your user means conversationally and contextually can be a difficult task, but can provide your bot a more natural conversation feel. Language Understanding, called LUIS, enables you to do just that so that your bot can recognize the intent of user messages, allow for more natural language from your user, and better direct the conversation flow. |
43
-
|[Multi-turn conversation support using Dialogs](https://docs.microsoft.com/azure/bot-service/bot-builder-concept-dialog?view=azure-bot-service-4.0)| The ability to manage conversations is an important part of the bot/user interation. Bot Framework introduces the concept of a Dialog to handle this conversational pattern. Dialog objects process inbound Activities and generate outbound responses. The business logic of the bot runs either directly or indirectly within Dialog classes. |
44
-
|[Managing conversation state](https://docs.microsoft.com/azure/bot-service/bot-builder-howto-v4-state?view=azure-bot-service-4.0)| A key to good bot design is to track the context of a conversation, so that your bot remembers things like the answers to previous questions. |
45
-
|[How to handle user-initiated interruptions](https://docs.microsoft.com/azure/bot-service/bot-builder-howto-handle-user-interrupt?view=azure-bot-service-4.0)| While you may think that your users will follow your defined conversation flow step by step, chances are good that they will change their minds or ask a question in the middle of the process instead of answering the question. Handling interruptions means making sure your bot is prepared to handle situations like this. |
46
-
|[How to unit test a bot](https://aka.ms/cs-unit-test-docs)| Optionally, the Core Bot template can generate corresponding unit tests that shows how to use the testing framework introduced in Bot Framework version 4.5. Selecting this option provides a complete set of units tests for Core Bot. It shows how to write unit tests to test the various features of Core Bot. To add the Core Bot unit tests, run the generator and answer `yes` when prompted. See below for an example of how to do this from the command line. |
47
-
48
32
#### Empty Bot Template
49
33
50
34
The Empty Bot template is the minimal skeleton code for a bot. It provides a stub `onTurn` handler but does not perform any actions. If you are experienced writing bots with Bot Framework v4 and want the minimum scaffolding, the Empty template is for you.
| Generate code in JavaScript or TypesScript | X | X | X |
57
-
| Support local development and testing using the [Bot Framework Emulator v4](https://www.github.com/microsoft/botframework-emulator)| X | X | X |
58
-
| Core bot message processing || X | X |
59
-
| Deploy your bot to Microsoft Azure || X | X |
60
-
| Welcome new users using Adaptive Card technology ||| X |
61
-
| Support AI-based greetings using [LUIS](https://www.luis.ai)||| X |
62
-
| Use Dialogs to manage more in-depth conversations ||| X |
63
-
| Manage conversation state ||| X |
64
-
| Handle user interruptions ||| X |
65
-
| Unit test a bot using Bot Framework Testing framework (optional) ||| X |
38
+
| Feature | Empty Bot | Echo Bot |
39
+
| --------- | :-----: | :-----: |
40
+
| Generate code in JavaScript or TypesScript | X | X |
41
+
| Support local development and testing using the [Bot Framework Emulator v4](https://www.github.com/microsoft/botframework-emulator)| X | X |
42
+
| Core bot message processing || X |
43
+
| Deploy your bot to Microsoft Azure || X |
66
44
67
45
## Installation
68
46
@@ -108,17 +86,16 @@ The generator supports a number of command line options that can be used to chan
108
86
| --botname, -N | The name given to the bot project |
109
87
| --description, -D | A brief bit of text that describes the purpose of the bot |
110
88
| --language, -L | The programming language for the project. Options are `JavaScript` or `TypeScript`. |
111
-
| --template, -T | The template used to generate the project. Options are `empty`, `echo`, or `core`. See [https://aka.ms/botbuilder-generator](https://aka.ms/botbuilder-generator) for additional information regarding the different template option and their functional differences. |
112
-
| --addtests | _A Core Bot Template Only Feature_. The generator will add unit tests to the Core Bot generated bot. This option is not available to other templates at this time. To learn more about the test framework released with Bot Framework v4.5, see [How to unit test bots](https://aka.ms/js-unit-test-docs). This option is intended to enable automated bot generation for testing purposes. |
89
+
| --template, -T | The template used to generate the project. Options are `empty` or `echo`. See [https://aka.ms/botbuilder-generator](https://aka.ms/botbuilder-generator) for additional information regarding the different template option and their functional differences. |
113
90
| --noprompt | The generator will not prompt for confirmation before creating a new bot. Any requirement options not passed on the command line will use a reasonable default value. This option is intended to enable automated bot generation for testing purposes. |
114
91
115
92
#### Example Using Command Line Options
116
93
117
-
This example shows how to pass command line options to the generator, setting the default language to TypeScript and the default template to Core.
94
+
This example shows how to pass command line options to the generator, setting the default language to TypeScript and the default template to Echo.
118
95
119
96
```bash
120
-
# Run the generator defaulting the language to TypeScript and the template to core
121
-
yo botbuilder --L "TypeScript" --T "core"
97
+
# Run the generator defaulting the language to TypeScript and the template to echo
98
+
yo botbuilder --L "TypeScript" --T "Echo"
122
99
```
123
100
124
101
### Generating a Bot Using --noprompt
@@ -133,7 +110,6 @@ The generator can be run in `--noprompt` mode, which can be used for automated b
133
110
| --description, -D | "Demonstrate the core capabilities of the Microsoft Bot Framework" |
134
111
| --language, -L | `JavaScript` |
135
112
| --template, -T | `echo` |
136
-
| --addtests | When specified, will cause the Core Bot template to add unit tests. |
137
113
138
114
#### Examples Using --noprompt
139
115
@@ -151,13 +127,6 @@ This example shows how to run the generator in --noprompt mode, using all the de
151
127
yo botbuilder --noprompt
152
128
```
153
129
154
-
This example shows how to run the generator in --noprompt mode, generating a TypeScript Core Bot with unit tests.
155
-
156
-
```bash
157
-
# Run the generator using all default options
158
-
yo botbuilder -N "my-core-bot-with-tests" -D "A core bot with tests in TypeScript" -L "TypeScript" -T "core" --addtests --noprompt
159
-
```
160
-
161
130
## Running Your Bot
162
131
163
132
### Running Your Bot Locally
@@ -202,15 +171,6 @@ The code generated by the botbuilder generator is lint compliant. Depending on
202
171
npm run lint
203
172
```
204
173
205
-
#### Testing Core Bots with Tests
206
-
207
-
Core Bot templates generated with unit tests can be tested using the following:
208
-
209
-
```bash
210
-
# launch mocha, run unit tests, report code coverage
211
-
npm test
212
-
```
213
-
214
174
## Deploy Your Bot to Azure
215
175
216
176
After creating the bot and testing it locally, you can deploy it to Azure to make it accessible from anywhere.
0 commit comments