Giter Site home page Giter Site logo

cmayomsft / promptly-dotnet Goto Github PK

View Code? Open in Web Editor NEW
8.0 3.0 6.0 137 KB

.NET conversation modelling library for building bots with Bot Builder SDK V4.

License: MIT License

C# 100.00%
bot bots bot-framework bot-builder conversation conversational-ui conversational-bots conversational-agents chatbot chatbots csharp dotnet

promptly-dotnet's Introduction

promptly-dotnet

Promptly is a personal/experimental SDK and is not a supported Microsoft product. Use at your own risk.

Promptly, like the Bot Builder SDK V4 it's based on, is in prerelease and subject to extensive change. Use at your own risk.

Overview

Promptly is a .NET library for building chat bots using the Bot Builder SDK V4 .NET.

Promptly provides an API for developing everything from complex, multi-turn topics of conversation to simple single-turn prompts in a simple and consistent way, so you can focus on your bot's conversational UI/UX (CUI) rather than the underlying details of conversation state and turn management.

Packages

You can install the Promptly-Bot package on nuget.

Getting Started

To get started clone/fork this repo, open the promptly-dotnet.sln, build the solution, and run/step through the AlarmBot sample starting at the MessagesController.

A more detailed README is coming soon.

promptly-dotnet's People

Contributors

cmayomsft avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

promptly-dotnet's Issues

Azure table storage for state

Hi,

I've been porting an old bot to the latest v4 SDK and have been trying out your project. The problem I'm having is with using AzureTableStorage. I've tried adding dictionary properties to my User and Conversation state models like this: https://github.com/Microsoft/botbuilder-dotnet/blob/master/samples-final/5.AspNetCore-MultiplePrompts-Bot/MultiplePromptsState.cs

Or just as a property within the state model, but to no avail.

I understand that AzureTableStorage will try to flatten objects, and as per some of the prompt examples I need to serialize the state models to a Dictionary<TK, TV>.

I've had a little play with the alarm bot example, but regardless of what I do I'm unable to get the state to serialize. There error you get is the same as this: Azure/azure-storage-net#426

I wonder if you have tried to get Azure table store working with Promptly and if you have any examples or pointers.

SubTopic can't maintain `HasActiveTopic` flag.

Hi, when I add async to SubTopic's OnReceiveActivity() and call await method, SubTopic can't maintain HasActiveTopic flag.

        public async override Task OnReceiveActivity(IBotContext context)
        {
            // HasActiveTopic is always false.
            if (HasActiveTopic)
            {
                await ActiveTopic.OnReceiveActivity(context);
            }

            // in this method, coll some async method.
            await this.SetActiveTopic(ADD_ALARM_TOPIC)
                    .OnReceiveActivity(context);
        }

Suggestion: provide default Validator implementation

(already discussed with @cmayomsft, adding an issue for visibility & tracking)

In the Prompt class, you can use Validator to specify which validator to use for that prompt.

generalPrompt.Set
    .OnPrompt((context, lastTurnReason) =>
    {
        context.Reply("You want an appointment?");
    })
    .Validator(new DummyValidator())
    .OnSuccess((context, value) =>
    {
        this.ClearActiveTopic();
...

If no Validator is specified, the prompt is not working anymore. It would be better to provide a default implemented Validator that validates everything to be accepted as input, so you can leave out the line that explicitly sets the Validator. Similar how MaxTurns is implemented.
Desired bot code:

generalPrompt.Set
    .OnPrompt((context, lastTurnReason) =>
    {
        context.Reply("You want an appointment?");
    })
    .OnSuccess((context, value) =>
    {
        this.ClearActiveTopic();
...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.