Skip to content

Commit

Permalink
Python Samples (microsoft#2078)
Browse files Browse the repository at this point in the history
* Initial move of Python samples

* Updated Samples README

* Corrected Python samples name and root README

* Corrected microsoft#44 sample name

* Corrected git url in Python samples

* Corrected date output format in 44.prompt-for-user-input

* Removed unwanted pycache files

* Added gitignore for all Python __pycache__ dirs.

* Added Python 07.using-adaptive-cards

* Added Python 14.nlp-with-dispatch

* Python 24-bot-authentication-msgraph basics (not complete)

* Updated README to include Python samples links

* Added 24.bot-authentication-msgraph

* Corrected 18.bot-authentication logout handling

* Added ARM templates to app samples and updated README's with link to Azure Deploy docs.

* Added missing template-with-new-rg.json files.

* Adjusted Python 06.using-cards to be like C# and JS

* Fixes microsoft#471: 05.multi-turn-prompt parity

* Added 46.teams-auth

* Added 56.teams-file-upload

* Moved Python generator to Samples/generators

* Fixes Python microsoft#474.  Typos in templates.

* Removed experimental from Python Samples

* adding teams conversation bot sample

* Refactored to use aiohttp, added traceback in error handlers.

* Updated to use aiohttp

* Added 55.teams-link-unfurling

* adding readme

* Corrected json_response for invoke responses.

* updating text for readme

* 02.echo-bot deploy as aiohttp

* 46.teams-auth parity with C#

* Update README.md

updating python version

* Updated Python generator templates to use aiohttp, and include ARM templates.

* fix handling of response from invoke_response

* Added deploymentTemplates for Teams bots.

* Initial move of Python samples

* Updated Samples README

* Corrected Python samples name and root README

* Corrected microsoft#44 sample name

* Corrected git url in Python samples

* Corrected date output format in 44.prompt-for-user-input

* Removed unwanted pycache files

* Added gitignore for all Python __pycache__ dirs.

* Added Python 07.using-adaptive-cards

* Added Python 14.nlp-with-dispatch

* Python 24-bot-authentication-msgraph basics (not complete)

* Updated README to include Python samples links

* Added 24.bot-authentication-msgraph

* Corrected 18.bot-authentication logout handling

* Added ARM templates to app samples and updated README's with link to Azure Deploy docs.

* Added missing template-with-new-rg.json files.

* Adjusted Python 06.using-cards to be like C# and JS

* Fixes microsoft#471: 05.multi-turn-prompt parity

* Added 46.teams-auth

* Added 56.teams-file-upload

* Moved Python generator to Samples/generators

* Fixes Python microsoft#474.  Typos in templates.

* Removed experimental from Python Samples

* adding teams conversation bot sample

* Refactored to use aiohttp, added traceback in error handlers.

* Updated to use aiohttp

* Added 55.teams-link-unfurling

* adding readme

* Corrected json_response for invoke responses.

* updating text for readme

* 02.echo-bot deploy as aiohttp

* adding search extension bot

* Corrected 'TokenResponse' object is not subscriptable error

* Corrected 07.using-adaptive-cards no displaying stars on restaurant card.

* Translation was failing (due to API change) in Python 17.multilingual-bot

* Added requirements.txt to 57.teams-conversation-bot

* Added explicit pip install instructions for 01.console-echo

* Removed botid in Teams manifest used during testing.

* Corrected validator in 19.custom-dialogs to handle non-cardinal input correctly.

* Update Python generator README

* Added startup.txt and adjust ARM templates to Python samples.

* add python teams sample 53

* remove appid and password

* Add python Teams Messaging Extension Action bot sample

* add python teams task module sample

* aiohttp to requirements

* update search messaging extension requirements

* add aiohttp to requirements.txt

* add aiohttp to requirements.txt

* Corrected Python 55.teams-link-unfurling config.py

* Fixed _message_all_members in Python 57.teams-conversation-bot

* Python 46.teams-auth: Added Teams manifest and corrected REAME with steps to deploy to Teams

* Corrected Python sample README's

* Updated Python botbuilder requirements to 4.7.0

* Corrected Python Teams samples READMEs

* Made Python Teams icon nameing consistent

* Python 57.teams-conversation-bot README

* Added Teams support to Python 25.bot-authentication=msgraph

* Removed references to Visual Studio in Python README's

* Ignoring "env/" in Python projects

* Updated Python generator requirements versions

* Put aiohttp startup command in the ARM instead of startup.txt

* Ptyhon 24.bot-authentication-msgraph: switched to requests_oauth intsead of microsoftgraph-python

* Python: Consistency changes in READMEs, pylint and black on newer samples.
  • Loading branch information
tracyboehrer authored and johnataylor committed Dec 19, 2019
1 parent 8e72abf commit 30c2159
Show file tree
Hide file tree
Showing 484 changed files with 38,993 additions and 26 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -283,3 +283,7 @@ tsconfig.tsbuildinfo
# Visual Studio
appsettings.Development.json
.config/

# Python
__pycache__/
env/
78 changes: 52 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

## Overview

This branch contains samples for the released version of the **Microsoft Bot Framework V4 SDK** for [.NET](https://github.com/Microsoft/botbuilder-dotnet) and [JS](https://github.com//microsoft/botbuilder-js). If you need samples for the Bot Framework _V3_ SDK, go [here](https://github.com/Microsoft/BotBuilder-Samples/tree/v3-sdk-samples). If you need Bot Framework V4 Python samples, go [here](https://github.com/Microsoft/botbuilder-python/tree/master/samples)
This branch contains samples for the released version of the **Microsoft Bot Framework V4 SDK** for [.NET](https://github.com/Microsoft/botbuilder-dotnet), [JS](https://github.com//microsoft/botbuilder-js) and [Python](https://github.com//microsoft/botbuilder-python). If you need samples for the Bot Framework _V3_ SDK, go [here](https://github.com/Microsoft/BotBuilder-Samples/tree/v3-sdk-samples).

## Samples list
Samples are designed to illustrate scenarios you'll need to implement to build great bots! To use the samples, clone this GitHub repository using Git.
Expand All @@ -15,34 +15,34 @@ Samples are designed to illustrate scenarios you'll need to implement to build g
cd BotBuilder-Samples
```

| Sample Name | Description | .NET CORE | JavaScript | .NET Web API | JS (es6) | TypeScript |
|-----------------------|--------------------------------------------------------------------------------|-------------|-------------|--------------|-------------|-------------|
|1.console-echo | Introduces the concept of adapter and demonstrates a simple echo bot on console adapter and how to send a reply and access the incoming message. |[View][cs#1] |[View][js#1] | | |[View][ts#1] |
| Sample Name | Description | .NET CORE | JavaScript | .NET Web API | JS (es6) | TypeScript | Python
|-----------------------|--------------------------------------------------------------------------------|-------------|-------------|--------------|-------------|-------------|-------------|
|1.console-echo | Introduces the concept of adapter and demonstrates a simple echo bot on console adapter and how to send a reply and access the incoming message. |[View][cs#1] |[View][js#1] | | |[View][ts#1] |[View][py#1]
|1.browser-echo | Demonstrates how to host a bot in the browser using Web Chat and a custom Web Chat Adapter. | | | |[View][es#1]| |
|2.echo-bot | Demonstrates how to receive and send messages. |[View][cs#2] |[View][js#2]| | |[View][ts#2] |
|3.welcome-user | Introduces activity types and provides a welcome message on conversation update activity. |[View][cs#3] |[View][js#3] | | | |
|5.multi-turn-prompt | Demonstrates how to use waterfall dialog, prompts, and component dialog to create a simple interaction that asks the user for name, age, and prints back that information. |[View][cs#5] |[View][js#5] | | | |
|6.using-cards | Introduces all card types including thumbnail, audio, media etc. Builds on Welcoming user + multi-prompt bot by presenting a card with buttons in welcome message that route to appropriate dialog. |[View][cs#6] |[View][js#6] | | | |
|7.using-adaptive-cards | Demonstrates how the multi-turn dialog can use a card to get user input for name and age. |[View][cs#7] |[View][js#7] | | | |
|8.suggested-actions | Demonstrates how to enable your bot to present buttons that the user can tap to provide input. |[View][cs#8] |[View][js#8] | | | |
|11.qnamaker | Demonstrates how to use QnA Maker to have simple single-turn conversations |[View][cs#11]|[View][js#11]| | | |
|13.core-bot | Core bot shows how to use cards, dialog, and Langugage Understanding (LUIS). |[View][cs#13]|[View][js#13]|[View][wa#13] | |[View][ts#13]|
|2.echo-bot | Demonstrates how to receive and send messages. |[View][cs#2] |[View][js#2]| | |[View][ts#2] |[View][py#2]
|3.welcome-user | Introduces activity types and provides a welcome message on conversation update activity. |[View][cs#3] |[View][js#3] | | | |[View][py#3]
|5.multi-turn-prompt | Demonstrates how to use waterfall dialog, prompts, and component dialog to create a simple interaction that asks the user for name, age, and prints back that information. |[View][cs#5] |[View][js#5] | | | |[View][py#5]
|6.using-cards | Introduces all card types including thumbnail, audio, media etc. Builds on Welcoming user + multi-prompt bot by presenting a card with buttons in welcome message that route to appropriate dialog. |[View][cs#6] |[View][js#6] | | | |[View][py#6]
|7.using-adaptive-cards | Demonstrates how the multi-turn dialog can use a card to get user input for name and age. |[View][cs#7] |[View][js#7] | | | |[View][py#7]
|8.suggested-actions | Demonstrates how to enable your bot to present buttons that the user can tap to provide input. |[View][cs#8] |[View][js#8] | | | |[View][py#8]
|11.qnamaker | Demonstrates how to use QnA Maker to have simple single-turn conversations |[View][cs#11]|[View][js#11]| | | |[View][py#11]
|13.core-bot | Core bot shows how to use cards, dialog, and Langugage Understanding (LUIS). |[View][cs#13]|[View][js#13]|[View][wa#13] | |[View][ts#13]|[View][py#13]
|13.core-bot.tests | Unit test project Core bot shows how to use use Bot Framework testing framework. |[View][cs#13.b]| | | | |
|14.nlp-with-dispatch | Demonstrates how to dispatch across LUIS and QnA Maker. |[View][cs#14]|[View][js#14]| | | |
|15.handling-attachments| Demonstrates how to listen for/handle user provided attachments. |[View][cs#15]|[View][js#15]| | | |
|16.proactive-messages | Demonstrates how to send proactive messages to users. |[View][cs#16]|[View][js#16]| | | |
|17.multilingual-bot | Using translate middleware to support a multi-lingual bot. Demonstrates custom middleware. |[View][cs#17]|[View][js#17]| | | |
|18.bot-authentication | Bot that demonstrates how to integrate OAuth providers. |[View][cs#18]|[View][js#18]| | | |
|19.custom-dialogs | Demonstrates complex conversation flow using the Dialogs library. |[View][cs#19]|[View][js#19]| | | |
|23.facebook-events | Integrate and consume Facebook specific payloads, such as post-backs, quick replies and opt-in events.|[View][cs#23] |[View][js#23] | | | |
|24.bot-auth-msgraph | Demonstrates bot authentication capabilities of Azure Bot Service. Demonstrates utilizing the Microsoft Graph API to retrieve data about the user.|[View][cs#24] |[View][js#24] | | | |
|40.timex-resolution | Demonstrates various ways to parse and manipulate the TIMEX expressions you get from LUIS and the [DateTimeRecognizer](https://github.com/Microsoft/recognizers-text) used by the DateTimePrompt. |[View][cs#40] |[View][js#40]| | | |
|42.scaleout | Demonstrates how you can build your own state solution from the ground up that supports scaled out deployment with ETag based optimistic locking. |[View][cs#42] | | | | |
|43.complex-dialog | Demonstrates different ways for composing dialogs. |[View][cs#43]|[View][js#43] | | | |
|44.prompt-for-user-input | Demonstrates how to implement your own _basic_ prompts to ask the user for information. |[View][cs#44]|[View][js#44]| | | |
|45.state-management | Demonstrates how to use state management and storage objects to manage and persist state. | [View][cs#45] | [View][js#45] | | | |
|14.nlp-with-dispatch | Demonstrates how to dispatch across LUIS and QnA Maker. |[View][cs#14]|[View][js#14]| | | |[View][py#14]
|15.handling-attachments| Demonstrates how to listen for/handle user provided attachments. |[View][cs#15]|[View][js#15]| | | |[View][py#15]
|16.proactive-messages | Demonstrates how to send proactive messages to users. |[View][cs#16]|[View][js#16]| | | |[View][py#16]
|17.multilingual-bot | Using translate middleware to support a multi-lingual bot. Demonstrates custom middleware. |[View][cs#17]|[View][js#17]| | | |[View][py#17]
|18.bot-authentication | Bot that demonstrates how to integrate OAuth providers. |[View][cs#18]|[View][js#18]| | | |[View][py#18]
|19.custom-dialogs | Demonstrates complex conversation flow using the Dialogs library. |[View][cs#19]|[View][js#19]| | | |[View][py#19]
|23.facebook-events | Integrate and consume Facebook specific payloads, such as post-backs, quick replies and opt-in events.|[View][cs#23] |[View][js#23] | | | |[View][py#23]
|24.bot-auth-msgraph | Demonstrates bot authentication capabilities of Azure Bot Service. Demonstrates utilizing the Microsoft Graph API to retrieve data about the user.|[View][cs#24] |[View][js#24] | | | |[View][py#24]
|40.timex-resolution | Demonstrates various ways to parse and manipulate the TIMEX expressions you get from LUIS and the [DateTimeRecognizer](https://github.com/Microsoft/recognizers-text) used by the DateTimePrompt. |[View][cs#40] |[View][js#40]| | | |[View][py#40]
|42.scaleout | Demonstrates how you can build your own state solution from the ground up that supports scaled out deployment with ETag based optimistic locking. |[View][cs#42] | | | | |[View][py#42]
|43.complex-dialog | Demonstrates different ways for composing dialogs. |[View][cs#43]|[View][js#43] | | | |[View][py#43]
|44.prompt-for-user-input | Demonstrates how to implement your own _basic_ prompts to ask the user for information. |[View][cs#44]|[View][js#44]| | | |[View][py#44]
|45.state-management | Demonstrates how to use state management and storage objects to manage and persist state. | [View][cs#45] | [View][js#45] | | | |[View][py#45]
|46.teams-auth | Demonstrates how to use authentication for a bot running in Microsoft Teams. | [View][cs#46] | [View][js#46] | | | |
|47.inspection | Demonstrates how to use middleware to allow the Bot Framework Emulator to debug traffic into and out of the bot in addition to looking at the current state of the bot. | [View][cs#47] | [View][js#47] | | | |
|47.inspection | Demonstrates how to use middleware to allow the Bot Framework Emulator to debug traffic into and out of the bot in addition to looking at the current state of the bot. | [View][cs#47] | [View][js#47] | | | |[View][py#47]
|48.qnamaker-active-learning-bot | Demonstrates how to integrate Active Learning in a QnA Maker bot.|[View][cs#48]|[View][js#48] | | | |
|49.qnamaker-all-features | Demonstrates how to integrate Multiturn and Active learning in a QnA Maker bot.|[View][cs#49]|[View][js#49] | | | |
|50.teams-messaging-extensions-search | A Messaging Extension that accepts search requests and returns results.|[View][cs#50]|[View][js#50] | | | |
Expand Down Expand Up @@ -141,6 +141,32 @@ Samples are designed to illustrate scenarios you'll need to implement to build g
[js#56]:samples/javascript_nodejs/56.teams-file-upload
[js#57]:samples/javascript_nodejs/57.teams-conversation-bot

[py#1]:samples/python/01.console-echo
[py#2]:samples/python/02.echo-bot
[py#3]:samples/python/03.welcome-user
[py#5]:samples/python/05.multi-turn-prompt
[py#6]:samples/python/06.using-cards
[py#7]:samples/python/07.using-adaptive-cards
[py#8]:samples/python/08.suggested-actions
[py#11]:samples/python/11.qnamaker
[py#13]:samples/python/13.core-bot
[py#14]:samples/python/14.nlp-with-dispatch
[py#15]:samples/python/15.handling-attachments
[py#16]:samples/python/16.proactive-messages
[py#17]:samples/python/17.multilingual-bot
[py#18]:samples/python/18.bot-authentication
[py#19]:samples/python/19.custom-dialogs
[py#21]:samples/python/21.corebot-app-insights
[py#23]:samples/python/23.facebook-events
[py#24]:samples/python/24.bot-authentication-msgraph
[py#40]:samples/python/40.timex-resolution
[py#42]:samples/python/42.scaleout
[py#43]:samples/python/43.complex-dialog
[py#44]:samples/python/44.prompt-for-user-input
[py#45]:samples/python/45.state-management
[py#46]:samples/python/46.teams-auth
[py#47]:samples/python/47.inspection

## Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a
Expand Down
21 changes: 21 additions & 0 deletions generators/python/LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2018 Microsoft Corporation

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading

0 comments on commit 30c2159

Please sign in to comment.