Giter VIP home page Giter VIP logo

cxuesong / botbuilder.standard Goto Github PK

View Code? Open in Web Editor NEW
22.0 6.0 9.0 192.74 MB

An unofficial CoreCLR targeted .NET Standard ported version of BotBuilder.

Home Page: https://github.com/CXuesong/BotBuilder.Standard/wiki

License: MIT License

C# 66.34% Batchfile 0.24% ASP 0.04% HTML 1.81% CSS 3.23% JavaScript 15.51% TypeScript 12.80% PowerShell 0.03%
bot microsoft-bot-framework bot-builder bot-framework

botbuilder.standard's Introduction

Bot Builder SDK

The Microsoft Bot Framework provides just what you need to build and connect intelligent bots that interact naturally wherever your users are talking, from text/sms to Skype, Slack, Office 365 mail and other popular services.

The Microsoft Bot Builder SDK is one of three main components of the Microsoft Bot Framework. It is a powerful, easy-to-use framework that provides a familiar way for .NET and Node.js developers to develop bots. The Bot Builder SDK provides features that make interactions between bots and users much simpler. Bot Builder also includes an emulator for debugging your bots, as well as a large set of sample bots you can use as building blocks.

Bot Framework

Think of a bot as an app that users interact with in a conversational way. Bots can communicate conversationally with text, cards , or speech. A bot may be as simple as basic pattern matching with a response, or it may be a sophisticated weaving of artificial intelligence techniques with complex conversational state tracking and integration to existing business services.

The Bot Framework enables you to build bots that support different types of interactions with users. You can design conversations in your bot to be freeform. Your bot can also have more guided interactions where it provides the user choices or actions. The conversation can use simple text strings or more complex rich cards that contain text, images, and action buttons. And you can add natural language interactions, which let your users interact with your bots in a natural and expressive way.

Developers writing bots all face the same problems: bots require basic I/O, they must have language and dialog skills, and they must connect to users, preferably in any conversation experience and language the user chooses. The Bot Framework provides powerful tools and features to help solve these problems and more with features like automatic translation to more than 30 languages, user and conversation state management, debugging tools, an embeddable web chat control and a way for users to discover, try, and add bots to the conversation experiences they love.

Review the documentation to get started with the Bot Builder SDK!

Get started quickly with our samples:

Join the conversation on Gitter.

See all the support options here.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

botbuilder.standard's People

Contributors

andrea-orimoto avatar bilby91 avatar brandonh-msft avatar carlosscastro avatar chrimc62 avatar crjens avatar cxuesong avatar dandriscoll avatar ejadib avatar evnik avatar hailiu2586 avatar huan avatar ibrahimonat avatar jameslew avatar jasonsowers avatar jeffders avatar jmendiara avatar mikkhait avatar msft-shahins avatar mulyoved avatar muzahmed avatar nwhitmont avatar pablocastro avatar pshelton-skype avatar robstand avatar santiagodoldan avatar stevengum avatar stevenic avatar swfbarhr avatar willportnoy avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

botbuilder.standard's Issues

Scorable is not fired

Bot Info

  • App ID:
  • SDK Platform: .NET Core
  • SDK Version: 3.12.2.6-int0
  • CXuesong.Ported.Microsoft.Bot.Builder Version="3.12.2.5"
  • CXuesong.Ported.Microsoft.Bot.Connector Version="3.12.2.6-int0"
  • CXuesong.Ported.Microsoft.Bot.Builder.Autofac" Version="3.12.2.5"
  • Active Channels: emulator
  • Deployment Environment: localhost

Issue Description

Scorable is not fired

Code Example

public sealed class SampleScorable : ScorableBase<IActivity, string, double>
{
    private readonly IDialogStack stack;
    private readonly IBotData botData;
    private readonly IBotToUser botToUser;
    private readonly string command = "Help";

    public SampleScorable(IDialogStack stack, IBotData botData, IBotToUser botToUser)
    {
        SetField.NotNull(out this.stack, nameof(stack), stack);
        SetField.NotNull(out this.botData, nameof(botData), botData);
        SetField.NotNull(out this.botToUser, nameof(botToUser), botToUser);
    }

    protected override async Task<string> PrepareAsync(IActivity activity, CancellationToken token)
    {
        var message = activity as IMessageActivity;
        if (message != null && message.Text != null)
        {
            var text = message.Text;
            if (command.Equals(command))
            {
                return message.Text;
            }
        }

        return null;
    }

    protected override bool HasScore(IActivity item, string state)
    {
        return state != null;
    }

    protected override double GetScore(IActivity item, string state)
    {
        return 1.0;
    }

    protected override async Task PostAsync(IActivity item, string state, CancellationToken token)
    {
        await botToUser.PostAsync("^^");
    }
    protected override Task DoneAsync(IActivity item, string state, CancellationToken token)
    {
        return Task.CompletedTask;
    }
}

Dialog register

builder.Register(c => new SampleScorable(c.Resolve(), c.Resolve(), c.Resolve()))
.As<IScorable<IActivity, double>>()
.InstancePerLifetimeScope();

Reproduction Steps

Expected Behavior

User Input on Bot: Help
Bot Response: ^^

Actual Results

Continue in current Dialog and not interrupted

PromptDialog.Confirm loop in .NET Core 2.0

Bot Info

  • App ID:
  • SDK Platform: .NET Framework & .NET Core
  • SDK Version: 3.12.2.4 (.NET Framework) and 3.12.2.5 (.NET Core)
  • Active Channels: Bot Emulator
  • Deployment Environment: Bot Emulator

Issue Description

I have the same code inside a .NET Framework 4.6.1 Web API project referencing the latest official Microsoft.Bot.* packages and a .NET Core 2.0 Web API project referencing the latest CXuesong.Ported.Microsoft.Bot.* packages. The root dialog is a LUIS dialog and what I am trying to do is respond with a confirm prompt in the None intent. This works as expected in the .NET Framework version, but results in a loop in the .NET Core version, where responding to the prompt results in another prompt.

Code Example

In the MessagesController:

if (activity != null && activity.GetActivityType() == ActivityTypes.Message)
{
    await Conversation.SendAsync(activity, () => new BasicLuisDialog());                
}
else
{
    HandleSystemMessage(activity);
}
return new HttpResponseMessage(System.Net.HttpStatusCode.Accepted);

In the BasicLuisDialog:

[LuisIntent("None")]
public async Task NoneIntent(IDialogContext context, LuisResult result)
{
    PromptDialog.Confirm(context, AfterAskInvestigate, "Would you like us to investigate and follow-up?");
}

private async Task AfterAskInvestigate(IDialogContext context, IAwaitable<bool> result)
{
    var investigate = await result;

    if (investigate)
        await context.PostAsync("OK, we're on the case.");
    else
        await context.PostAsync("No problem, we'll leave it.");

    context.Wait(MessageReceived);
}

Reproduction Steps

  1. Fire up the bot emulator and send it a message that matches the None intent.
  2. A confirm prompt is sent back to the user.
  3. Click on either Yes or No.

Expected Behavior

After responding to the confirm prompt, the ResumeAfter function should execute.

Actual Results

This works as expected in the .NET Framework version, but in .NET Core 2.0 any response to the confirm prompt is treated like a new conversation and you are presented with the prompt again - the ResumeAfter function never executes.

'IDialogContext' does not contain a definition for 'Done'

Bot Info

  • SDK Platform: .NET
  • SDK Version: CXuesong.Ported.Microsoft.Bot.Builder 3.12.2.5
  • Active Channels: emulator
  • Deployment Environment: localhost

Issue Description

'Microsoft.Bot.Builder.Dialogs.IDialogContext' does not contain a definition for 'Done'

Code Example

   public Task StartAsync(IDialogContext context)
    {
        context.PostAsync($"[CatalogDialog] I am the Catalog dialog.");
        context.Call(new CatalogFilterDialog(), ExecutedCatalogFilterAsync);
        return Task.CompletedTask;
    }
  private async  Task ExecutedCatalogFilterAsync(IDialogContext context, IAwaitable<CatalogFilter> result)
    {
        var catalogFilter = await result;          /// <-- Excpetion throw here
        context.Wait(MessageReceivedAsync);
    }

  public class CatalogDialog : IDialog<object>
  {
       [...]
       context.Done(filter);
       [...]
  }

Expected Behavior

  retrieve filter object on ExecutedCatalogFilterAsync

Actual Results

Exception: 'Microsoft.Bot.Builder.Dialogs.IDialogContext' does not contain a definition for 'Done'

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.