This release is a pre-release and may not be stable for production use.
Dialog Prompts
This is a (currently experimental) suite of dialog prompts that uses Microsoft's recognizer text suite to recognize certain types of input during a dialog prompt. Microsoft's Bot Framework team has implemented a handful of prompts using recognizers from the recognizer text suite. This library is meant to fill the gaps.
Currently, this library and subsequent PIP are experimental. Please use at your own risk. Feel free to test, debug, and submit pull requests if you come across any issues.
Installation
You can install this library via PIP:
## Coming soon
Number with Unit
The number with unit prompt allows you to prompt for four different unit types:
- Currency
- Temperature
- Age
- Dimension (eg. miles / meters)
dialogs.add(new NumberWithUnitPrompt('numberPrompt', NumberWithUnitPromptType.Currency);
Then, you can call the bot by specifying your PromptOptions and calling PromptAsync.
options = PromptOptions(
prompt = Activity(
type = ActivityTypes.message,
text = "Enter the curreny info"
)
)
await step_context.prompt("numberprompt",options)
The prompt will return a NumberWithUnitResult.The object contains a value and unit type. For example, if a user enters "twenty three dollars" when you are using the Currency prompt type, the resulting NumberWithUnitResult object will have Unit: "Dollar", Value: "23". Below is an example of how you might use this result.
result = f"currency : {turn_context.result.value} and unit : {turn_context.result.unit}"
await turn_context.send_activity(result)
Number with Type
Number with type allows you to accept numbers from the follow type enum:
- Ordinal
- Percentage
dialogs.add(new NumberWithTypePrompt('numberPrompt', NumberWithTypePromptType.Ordinal);
The prompt will a return a result based on the NumberWithTypePromptType type. For example , If user enters “eleventh” Ordinal type return the result as 11. Below is an example of how you might use this result.
result = step_context.result
await turn_context.send_activity(result)
Phone Number
The PhoneNumberPrompt will extract a phone number from a message from the user.
dialogs.add(new PhoneNumberPrompt('phprompt');
Example
User : My phone number is 1 (877) 609-2233
PhoneNumberPrompt return as 1 (877) 609-2233
Email Address
The EmailPrompt will extract an email address from a message from the user.
dialogs.add(new EmailPrompt('eprompt');
Example
User : My email id is r.vinoth@live.com
EmailPrompt return as r.vinoth@live.com
Internet Protocols
The InternetProtocolPrompt will extract one of the following types based on which InternetProtocolPromptType enum value is passed in:
- IPAddress
- URL
dialogs.add(InternetProtocolPrompt("urlprompt",InternetProtocolPromptType.URL))
Example
User : My favorite web site is http://rvinothrajendran.github.io/
InternetProtocolPrompt return as http://rvinothrajendran.github.io/
GUID
The GUIDPrompt will extract a GUID from a message from the user.
dialogs.add(new GuidPrompt('gprompt');
Example
User : my azure id is "7d7b0205-9411-4a29-89ac-b9cd905886fa"
GUIDPrompt return as "7d7b0205-9411-4a29-89ac-b9cd905886fa"
Metadata
Release files for botbuilder-community-dialogs-prompts 0.1.0rc441
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| botbuilder_community_dialogs_prompts-0.1.0rc441-py3-none-any.whl | Python 3 | none | any | Details |
Release files / botbuilder_community_dialogs_prompts-0.1.0rc441-py3-none-any.whl
| Download URL | botbuilder_community_dialogs_prompts-0.1.0rc441-py3-none-any.whl |
|---|---|
| Size | 9.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d1663214919dd25a71aeb6ad1fafbd9b70a6002810251b121f2e6dae0425aa51
|
|
BLAKE2b-256 checksum How to use checksums |
c9ccc02c07b305b97c0046d9ca4908775f8f49e84e365a621309a8712fc37c81
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.39.0 CPython/3.6.8
|
Security for botbuilder-community-dialogs-prompts 0.1.0rc441
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.