Coder Social home page Coder Social logo

microsoft / botframework-sdk Goto Github PK

View Code? Open in Web Editor NEW
7.3K 445.0 2.4K 227.04 MB

Bot Framework provides the most comprehensive experience for building conversation applications.

License: MIT License

Roff 0.13% Python 1.14% JavaScript 87.85% C# 1.57% HTML 1.46% ANTLR 1.10% TypeScript 6.58% Batchfile 0.17%
bot microsoft-bot-framework sdk bot-builder bot-framework nodejs csharp azure-bot-service dotnetcore javascript

botframework-sdk's Introduction

Bot Framework

Bot Framework provides the most comprehensive experience for building conversation applications.

With the Bot Framework SDK, developers can build bots that converse free-form or with guided interactions including using simple text or rich cards that contain text, images, and action buttons.

Developers can model and build sophisticated conversation using their favorite programming languages including C#, JS, and Python for developers and multi-disciplinary teams to design and build conversational experiences.

Checkout the Bot Framework ecosystem section to learn more about other tooling and services related to the Bot Framework SDK.

Quicklinks

| C# Repo | JS Repo | Python Repo | BF CLI |

Bot Framework SDK v4

The Bot Framework SDK v4 is an open source SDK that enable developers to model and build sophisticated conversation using their favorite programming language.

C# JS Python
Stable Release packages packages packages
Docs docs docs docs
Samples .NET Core, WebAPI Node.js , TypeScript, es6 Python

Channels and Adapters

There are two ways to connect your bot to a client experience:

  • Azure Bot Service Channel - Language and SDK independent support via Azure Bot Service
  • Bot Framework SDK Adapter - A per language Adapter component
Client Azure Channel C# Adapter JS Adapter
Microsoft Teams Azure
Direct Line Azure
Web Chat Azure Botkit
Skype Azure
Email Azure
Facebook Azure Community Botkit
Slack Azure Community Botkit
Kik Azure
Telegram Azure
Line Azure
GroupMe Azure
Twilio (SMS) Azure Community Botkit
Alexa Skills Community Community
Google Actions Community Community
Google Hangouts Botkit
WebEx Community Botkit
WhatsApp (Infobip) Community
Zoom Community
RingCentral Community
Cortana Azure
Console Community

Community Open Source Projects

The following open source communities make various components available to extend your bot application, including adapters, recognizers, dialogs and middleware.

C# JavaScript Python
Bot Framework Community C# JavaScript Python
Botkit JavaScript

Questions and Help

If you have questions about Bot Framework SDK or using Azure Bot Service, we encourage you to reach out to the community and Azure Bot Service dev team for help.

See all of the available support options here.

Issues and feature requests

We track functional issues and features asks for the Bot Framework SDK, tools and Azure Bot Service in a variety of locations. If you have found an issue or have a feature request, please submit an issue to the below repositories.

Item Description Link
SDK v4 .NET core bot runtime for .NET, connectors, middleware, dialogs, prompts, LUIS and QnA File an issue
SDK v4 JavaScript core bot runtime for Typescript/Javascript, connectors, middleware, dialogs, prompts, LUIS and QnA File an issue
SDK v4 Python core bot runtime for Python, connectors, middleware, dialogs, prompts, LUIS and QnA File an issue
Bot Framework CLI bot framework cli tools File an issue
Webchat bot framework web chat tool File an issue

Prior releases

  • Bot Builder v3 SDK has been migrated to the Bot Framework SDK V3 repository. The V3 SDK is retired with final long-term support ending on December 31st, 2019

Bot Framework ecosystem

Azure Bot Service

Azure Bot Service enables you to host intelligent, enterprise-grade bots with complete ownership and control of your data. Developers can register and connect their bots to users on Skype, Microsoft Teams, Cortana, Web Chat, and more. [Docs]

  • Direct Line JS Client: If you want to use the Direct Line channel in Azure Bot Service and are not using the WebChat client, the Direct Line JS client can be used in your custom application. [Readme]

  • Direct Line Speech Channel: We are bringing together the Bot Framework and Microsoft's Speech Services to provide a channel that enables streamed speech and text bi-directionally from the client to the bot application. To sign up, add the 'Direct Line Speech' channel to your Azure Bot Service.
  • Better isolation for your Bot - Direct Line App Service Extension : The Direct Line App Service Extension can be deployed as part of a VNET, allowing IT administrators to have more control over conversation traffic and improved latency in conversations due to reduction in the number of hops. Get started with Direct Line App Service Extension here. A VNET lets you create your own private space in Azure and is crucial to your cloud network as it offers isolation, segmentation, and other key benefits.

Bot Framework Emulator

The Bot Framework Emulator is a cross-platform desktop application that allows bot developers to test and debug bots built using the Bot Framework SDK. You can use the Bot Framework Emulator to test bots running locally on your machine or to connect to bots running remotely. [Download latest | Docs]

Bot Framework Web Chat

The Bot Framework Web Chat is a highly customizable web-based client chat control for Azure Bot Service that provides the ability for users to interact with your bot directly in a web page. [Stable release | Docs | Samples]

Bot Framework CLI

The Bot Framework CLI Tools hosts the open source cross-platform Bot Framework CLI tool, designed to support building robust end-to-end development workflows. The Bot Framework CLI tool replaced the legacy standalone tools used to manage bots and related services. BF CLI aggregates the collection of cross-platform tools into one cohesive and consistent interface.

Bot Framework Composer

Bot Framework Composer is an integrated development tool for developers and multi-disciplinary teams to build bots and conversational experiences with the Microsoft Bot Framework. Within this tool, you'll find everything you need to build a sophisticated conversational experience.

Botkit

Botkit is a developer tool and SDK for building chat bots, apps and custom integrations for major messaging platforms. Botkit bots hear() triggers, ask() questions and say() replies. Developers can use this syntax to build dialogs - now cross compatible with the latest version of Bot Framework SDK.

In addition, Botkit brings with it 6 platform adapters allowing Javascript bot applications to communicate directly with messaging platforms: Slack, Webex Teams, Google Hangouts, Facebook Messenger, Twilio, and Web chat.

Botkit is part of Microsoft Bot Framework and is released under the MIT Open Source license

Related Services

Language Understanding

A machine learning-based service to build natural language experiences. Quickly create enterprise-ready, custom models that continuously improve. Language Understanding Service(LUIS) allows your application to understand what a person wants in their own words. [Docs | Add language understanding to your bot]

QnA Maker

QnA Maker is a cloud-based API service that creates a conversational, question-and-answer layer over your data. With QnA Maker, you can build, train and publish a simple question and answer bot based on FAQ URLs, structured documents, product manuals or editorial content in minutes. [Docs | Add qnamaker to your bot]

Dispatch

Dispatch tool lets you build language models that allow you to dispatch between disparate components (such as QnA, LUIS and custom code). [Readme]

Speech Services

Speech Services convert audio to text, perform speech translation and text-to-speech with the unified Speech services. With the speech services, you can integrate speech into your bot, create custom wake words, and author in multiple languages. [Docs]

Adaptive Cards

Adaptive Cards are an open standard for developers to exchange card content in a common and consistent way, and are used by Bot Framework developers to create great cross-channel conversatational experiences.

  • Open framework, native performance - A simple open card format enables an ecosystem of shared tooling, seamless integration between apps, and native cross-platform performance on any device.
  • Speech enabled from day one - We live in an exciting era where users can talk to their devices. Adaptive Cards embrace this new world and were designed from the ground up to support these new experiences.

Contributing

See our contributing guidelines.

Reporting Security Issues

Security issues and bugs should be reported privately, via email, to the Microsoft Security Response Center (MSRC) at [email protected]. You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your original message. Further information, including the MSRC PGP key, can be found in the Security TechCenter.

Copyright (c) Microsoft Corporation. All rights reserved.

botframework-sdk's People

Contributors

andrea-orimoto avatar brandonh-msft avatar carlosscastro avatar chrimc62 avatar clearab avatar cleemullins avatar dandriscoll avatar daveta avatar ericdahlvang avatar franciscoponcegomez avatar gabog avatar hcyang avatar huan avatar jameslew avatar jasonsowers avatar jeffders avatar msft-shahins avatar muzahmed avatar nwhitmont avatar pablocastro avatar pshelton-skype avatar scheyal avatar sgellock avatar stevengum avatar stevenic avatar tomlm avatar tracyboehrer avatar tsuwandy avatar vishwacsena 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

botframework-sdk's Issues

LuisDialog doesn't react on questions

Hi,
I'm trying to use LuisDialog with "Cortana Models Prebuilt App", but it doesn't work with current API. When I send "turn on my wake up alarm", I get JSON result as below:

{
  "query": null,
  "intents": [
    {
      "intent": "builtin.intent.alarm.set_alarm",
      "score": null,
      "actions": null
    }
  ],
  "entities": [
    {
      "entity": "on",
      "type": "builtin.alarm.alarm_state"
    },
    {
      "entity": "wake up",
      "type": "builtin.alarm.title"
    }
  ]
}

The result has one intent with already set property score, so the LuisDialog doesn't set score to 1.0 and the intent is completely ignored.

[NodeJs] Getting 'Intent recognition error: Unexpected end of input' when using LUIS

I'm getting this error when trying the LuisDialog example in the tutorial. Note that I'm using the latest version 0.6.5:
events.js:141 throw er; // Unhandled 'error' event ^ Error: Intent recognition error: Unexpected end of input at C:\Users\Admin\Documents\AWBot\node_modules\botbuilder\lib\dialogs\IntentDialog.js:42:44 at Request._callback (C:\Users\Admin\Documents\AWBot\node_modules\botbuilder\lib\dialogs\LuisDialog.js:37:17) at Request.self.callback (C:\Users\Admin\Documents\AWBot\node_modules\botbuilder\node_modules\request\request.js:199:22) at emitTwo (events.js:87:13) at Request.emit (events.js:172:7) at Request.<anonymous> (C:\Users\Admin\Documents\AWBot\node_modules\botbuilder\node_modules\request\request.js:1036:10) at emitOne (events.js:82:20) at Request.emit (events.js:169:7) at IncomingMessage.<anonymous> (C:\Users\Admin\Documents\AWBot\node_modules\botbuilder\node_modules\request\request.js:963:12) at emitNone (events.js:72:20)

Multiturn bot example quitting for no apparent reason

I only added a few intents and a single entity on luis.ai, (no code changes in the example .js!) and then when I type in anything the example just exits without an explanation or error code.
That doesn't make sense to me, it should at least throw some kind of exception or explanation right?
It should never just quit..

Suggestion: Luis Entity Attribute

Hiya
After waking up this morning. I had an idea or suggestion that to help with mapping Luis Entity Items was to decorate properties with an attribute to map the Entity type to.

[LuisEntity("User")]
property string User { get; set; }

[LuisEntity("builtin.datetime.time")]
property TimeSpan TimeToConvert { get; set; }

C# - Bot Emulator @Mentions Empty in Message object

I am using the Bot Emulator and typing into the window the following message:
What time is it for @paul at 2 in the afternoon?

In the Microsoft.Bot.Connector.Message class I was expecting the mentions property on the object to be populated with paul or @paul

I am not entirely sure if this is a bug or me not understanding how this property gets populated in the API

Luis Entity - Missing Resolution Property

After speaking with @dandriscoll via Twitter this has been agreed it's a bug. See discussion on Twitter for some context - https://twitter.com/thedandriscoll/status/715655705605189632

I am using one of the built in entities in Luis such as DateTime and when the ChatBot calls my method when it matches my Intention attribute, I was expecting the entity for the built in DateTime would be machine readable in the Entity property on the EntityRecommendation class or much better preffered to match better with the JSON API returned from Luis to include the Resolution

Here is a sample payload of JSON I receive from my Luis app

{
  "query": "What time is it for paul at 2 in the afternoon?",
  "intents": [
    {
      "intent": "TimeForUser",
      "score": 0.602315068,
      "actions": [
        {
          "triggered": true,
          "name": "TimeForUser",
          "parameters": [
            {
              "name": "User",
              "required": true,
              "value": [
                {
                  "entity": "paul",
                  "type": "User",
                  "score": 0.9330815
                }
              ]
            },
            {
              "name": "Time",
              "required": true,
              "value": [
                {
                  "entity": "2 in the afternoon",
                  "type": "builtin.datetime.time",
                  "resolution": {
                    "time": "T14"
                  }
                }
              ]
            }
          ]
        }
      ]
    },

issue with bot for slack.

I follow the steps to set up slack channel. and I had bot join the slack channel as well.
However, when i tried to talk to bot. It message me back "Unauthorized".....
I am sure the secret is correct. anyone knows why?
31_x_31_21-58-36

[NodeJS] EntityRecognizer.resolveTime() doesn't handle all LUIS placeholder dates & times

LUIS will return a date entity with a XXXX-06-27 when the user says something like "lets meet on june 27th". This indicates that they don't know the year and ultimately we want the EntityRecognizer.resolveTime() to convert this to 2016-06-27. Right now it just ignores the date when this happens. I need to add support to resolveTime() to deal with all of the various placeholder formats (there are a bunch) and write unit tests to test them all.

The tricky bit is for an utterance like "lets meet on june 27th" its obvious that the year should be 2016. But for an utterance like "I did that on june 27th" it's probably referring to 2015. LUIS has no clue which to do in this case otherwise it would do it. That's why it leaves it ambiguous in the first place. I'm leaning towards adding a flag that lets the developer control the resolving with "future", "past", "nearest", or "none". Open to suggestions.

Form Dialog validation feedback makes it so that that the message from the next Dialog doesn't show

So I have a fairly simple setup where I am using a LuisDialog to return a FormDialog if someone asks for a joke to be told

     [LuisIntent("garmin_joke")]
        public async Task TellGarminJoke(IDialogContext context, LuisResult result)
        {
            var entities = new List<EntityRecommendation>(result.Entities);
            await Task.Delay(1);
            var fd = new FormDialog<GarminJoke>(new GarminJoke(), () => { return GarminJoke.BuildForm(); }, FormOptions.PromptInStart, entities);
            context.Call<GarminJoke>(fd, GarminJokeComplete);
        }

This works fine but I decided to add some validation to test that out

  public static IForm<GarminJoke> BuildForm()
        {
            return new FormBuilder<GarminJoke>()
                        .Message("So you want a Garmin Joke")
                        .Field(nameof(GarminJoke.Dirtyness),
                            validate: async (state, response) =>
                            {
                                var result = new ValidateResult { IsValid = true };
                                await Task.Delay(1);
                                var dirty = (Dirty)response;
                                if (dirty == Dirty.CleanLikeJon)
                                {
                                    result.Feedback = "I am sorry but there are no Garmin Jokes that are that clean. Try again or you can cancel.";
                                    result.IsValid = false;
                                }
                                if (dirty == Dirty.DirtyAsKen)
                                {
                                    result.Feedback = "Garmin Jokes aren't that dirty... but I'll see if I can get one of the better ones involving Ken";
                                    result.IsValid = true;
                                }
                                return result;
                            })
                        .Build();
        }

This all works if they pick an invalid option it lets them pick again... but if I add some feedback or just a note about what they picked the feedback is sent to the chat client but the actual joke who's code does get run never actually makes it to the chat client.

TypeError: Cannot read property 'id' of undefined

While running the basics-multiTurn example, I get the following error on 0.6.5.

.../node_modules/botbuilder/lib/Session.js:123
        r.childId = ss.callstack[ss.callstack.length - 1].id;
                                                         ^

TypeError: Cannot read property 'id' of undefined
    at Session.endDialog (../node_modules/botbuilder/lib/Session.js:123:58)
    at ../node_modules/botbuilder/lib/dialogs/IntentDialog.js:42:25
    at Request._callback (../node_modules/botbuilder/lib/dialogs/LuisDialog.js:37:17)
    at Request.self.callback (../node_modules/botbuilder/node_modules/request/request.js:199:22)
    at emitTwo (events.js:87:13)
    at Request.emit (events.js:172:7)
    at Request.<anonymous> (../node_modules/botbuilder/node_modules/request/request.js:1036:10)
    at emitOne (events.js:82:20)
    at Request.emit (events.js:169:7)
    at IncomingMessage.<anonymous> (../node_modules/botbuilder/node_modules/request/request.js:963:12)

Bot Emulator Null Reference Exception

I don't know if this is the right place to raise this issue but Emulator crashes when I try to connect to my application created with the application template

Application: Bot Framework Emulator.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.NullReferenceException
Stack:
at System.Runtime.CompilerServices.AsyncMethodBuilderCore+<>c__DisplayClass2.b__3(System.Object)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(System.Object)
at MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(System.Object)
at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)
at MS.Internal.CulturePreservingExecutionContext.Run(MS.Internal.CulturePreservingExecutionContext, System.Threading.ContextCallback, System.Object)
at System.Windows.Threading.DispatcherOperation.Invoke()
at System.Windows.Threading.Dispatcher.ProcessQueue()
at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
at MS.Win32.HwndWrapper.WndProc(IntPtr, Int32, IntPtr, IntPtr, Boolean ByRef)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(System.Object)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate, System.Object, Int32)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(System.Object, System.Delegate, System.Object, Int32, System.Delegate)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority, System.TimeSpan, System.Delegate, System.Object, Int32)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr, Int32, IntPtr, IntPtr)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(System.Windows.Interop.MSG ByRef)
at System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame)
at System.Windows.Threading.Dispatcher.PushFrame(System.Windows.Threading.DispatcherFrame)
at System.Windows.Application.RunDispatcher(System.Object)
at System.Windows.Application.RunInternal(System.Windows.Window)
at System.Windows.Application.Run(System.Windows.Window)
at System.Windows.Application.Run()
at BotFrameworkEmulator.App.Main()

Dialog with Dynamic Questions

What guidance can you offer to support database driven dialogs? Based on user input in the dialog, I would like to query a database (or external service) as an intermediate step in the dialog. None of the documentation mentions this, but it seems like it would be a common scenario. For example, the sandwich choices in the sandwich bot sample would most certainly be driven by an external dependency in the real-world.

AnnotatedSandwichBot SandwichOrderFormComplete missing?

When the SandwichOrder Form is completed I'd like to store the order. I didn't find any code in the sample where I could add the logic to store the successfully completed order. I think storing the resulting form is essential for any bot.

I would also like to detect if the user quits the form and which steps of the form had been completed. This would allow to analyze the order process and where users abandon there order.

[NodeJS] sending back-to-back replies with BotConnectorBot isn't working

We need to add a queue that slows down the rate at which we send back-to-back messages from a bot. Looks like when we send an inline reply using session.send() and immediately follow it with a Prompts.choice() call the second call never makes it through. Could be that out-of-band messages are still broken or their just clobbering each other. Either way something is up.

GUID like value is showing in title on skype web app

Don't know this is right place to submit issue.

I have added couple of bots from bot directory like Bing new and Bing music to skype. It has been added successfully to Skype. But in contacts list it is showing some GUID like value. Please check the image uploaded.
image

Cannot resolve LUIS date/time because of missing resolution_type

I'm not able to resolve the LUIS date/time by using the resolveTime function. The problem seems to be that the resolution_type is not set in the entity.resolution object. As a workaround, I'm currently setting the resolution_type manually for every entity before calling resolveTime:

args.entities.forEach((entity) => {
    if (entity.resolution) {
        entity.resolution.resolution_type = entity.type;
    }
});

Suggestion: Web Chat component initial message

It would be nice if the initial message from the bot web chat component was the response to "BotAddedToConversation" instead of the default "Hi! I'm {name}. Say "hi" if you'd like to chat"".

This adds to general personalization, but is also necessary for i18n (for I intend to use the bot to chat in Portuguese). I'm not sure this issue belongs to the BotBuilder SDK (Bot Connector instead?), but that's the only issue-tracking I could find.

Exception: invalid need: expected Wait, have Done

I receive exception in emulator, when doing EchoBot with Bot Builder exactly as shown in documentation. (EchoDialog is copy pasted)

Message and stack-trace are not very informative. I can't understand what exactly is wrong in my code.

The same project works well if I do it without Bot Builder.

{
  "message": "An error has occurred.",
  "exceptionMessage": "invalid need: expected Wait, have Done",
  "exceptionType": "Microsoft.Bot.Builder.Internals.Fibers.InvalidNeedException",
  "stackTrace": "   в Microsoft.Bot.Builder.Internals.Fibers.Wait`1.ValidateNeed(Need need)\r\n   в Microsoft.Bot.Builder.Internals.Fibers.Wait`1.Microsoft.Bot.Builder.Internals.Fibers.IWait.Post[D](D item)\r\n   в Microsoft.Bot.Builder.Internals.Fibers.Extensions.Post[T](IFiber fiber, T item)\r\n   в Microsoft.Bot.Builder.Dialogs.Internals.DialogContext.<Microsoft-Bot-Builder-Dialogs-Internals-IUserToBot-SendAsync>d__20.MoveNext()\r\n--- Конец трассировка стека из предыдущего расположения, где возникло исключение ---\r\n   в System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   в System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   в Microsoft.Bot.Builder.Dialogs.Conversation.<SendAsync>d__2.MoveNext()\r\n--- Конец трассировка стека из предыдущего расположения, где возникло исключение ---\r\n   в System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   в System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   в System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()\r\n   в Bot.Controllers.MessagesController.<Post>d__0.MoveNext() в C:\\work\\TsyaBot\\Bot\\Controllers\\MessagesController.cs:строка 22\r\n--- Конец трассировка стека из предыдущего расположения, где возникло исключение ---\r\n   в System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   в System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   в System.Threading.Tasks.TaskHelpersExtensions.<CastToObject>d__3`1.MoveNext()\r\n--- Конец трассировка стека из предыдущего расположения, где возникло исключение ---\r\n   в System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   в System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   в System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext()\r\n--- Конец трассировка стека из предыдущего расположения, где возникло исключение ---\r\n   в System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   в System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   в System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext()\r\n--- Конец трассировка стека из предыдущего расположения, где возникло исключение ---\r\n   в System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   в System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   в System.Web.Http.Filters.AuthorizationFilterAttribute.<ExecuteAuthorizationFilterAsyncCore>d__2.MoveNext()\r\n--- Конец трассировка стека из предыдущего расположения, где возникло исключение ---\r\n   в System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n   в System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   в System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__1.MoveNext()"
}

No Examples of Conditional Dialogs?

So I have been reading over the examples (in C#) and I am not seeing any examples of how to conditionally decide which dialog to return. So as an example I have a bot that listens to all messages. If someone asks to tell a joke then I want to return the IFormDialog that lets them pick the type of joke. If on the other hand someone asks "What's the weather" I want to return an IFormDialog this has to be already baked in but I am not seeing it anywhere

No authorization header

My BotConnectorBot isn't working because there's no header passed from Microsoft's server. When I get a message it looks like:

{ 'x-correlating-operationid': 'V4fVa2VBh3M=.dAA=.MQA2ADkANAAyADYANgAxADcAOQA2ADYANAA5ADYANgA1AA==.oTDx9LyL0QE=.91gOrML9EKM=.cZUdfQ4Gdb2Q/0P5Gke2MBv/5BWWh5g1z0aLdio0Nzs=',
  'content-type': 'application/json; charset=utf-8',
  host: 'xxx.xxx.xxx.xxx:3978',
  'content-length': '952',
  expect: '100-continue' }
{
  "type": "Message",
  "id": "xxx",
  "conversationId": "xxx",
  "created": "2016-04-01T01:14:21.8846104Z",
  "language": "en",
  "text": "awdawdawdawdawd",
  "attachments": [],
  "from": {
    "name": "devportal",
    "channelId": "test",
    "address": "devportal",
    "id": "xxx",
    "isBot": false
  },
  "to": {
    "name": "ChesterBot",
    "channelId": "test",
    "address": "chester",
    "id": "chester",
    "isBot": true
  },
  "participants": [
    {
      "name": "devportal",
      "channelId": "test",
      "address": "devportal",
      "id": "xxx",
      "isBot": false
    },
    {
      "name": "ChesterBot",
      "channelId": "test",
      "address": "chester",
      "id": "chester",
      "isBot": true
    }
  ],
  "totalParticipants": 2,
  "mentions": [],
  "channelConversationId": "chester",
  "hashtags": []
}

The BotConnectorBot then denies the connection because it's missing a header. Here's the code I'm running on my side, although I think it's an issue with Microsoft's servers:

var restify = require('restify');
var builder = require('botbuilder');

// Create bot and add dialogs
var bot = new builder.BotConnectorBot({ appId: 'xxx', appSecret: 'xxx' });
bot.add('/', function (session) {
   session.send('Hello World'); 
});

// Setup Restify Server
var server = restify.createServer();
server.post('/api/messages', bot.verifyBotFramework(), bot.listen());
server.listen(process.env.port || 3978, 'xxx', function () {
   console.log('%s listening to %s', server.name, server.url);
});

FormFlow quit command seems to fail

I'm testing the "AnnotatedSandwichBot". It works as expected - with the exception of the quit command.

After I enter quit I though that the "session" ends and new starts. But what ever I enter after quit is only answered with an empty message from the bot.

Is quit broken or did I misunderstand the purpose of that command?

image

Send multi-line replys or send multiple replies to make it look multi-lined

In providing options to my users to help them with the Luis intent I wanted to add a help command. However it looks all messed up when I try to reply with new-lines. Trying to do it in multiple calls such as this

await context.PostAsync($"Ok! {message} start off the game.");
await context.PostAsync($"{_options}");
only desplays the first. I followed the example of Alarm bot and it works similar. Search on the documentation or some more examples would be great.

Thanks
Kevin

IDialogStack.Call(IDialog child, ResumeAfter<R> resume) throws serialization exception when receiving lambda expression as ResumeAfter<R> argument

If you pass an anonymous function to the ResumeAfter-parameter of the IDialogStack.Call()-method, you will receive a serialization exception when the dialog is created at runtime.

This code snippet throws the error:

context.Call<bool>(pongDialog, async (ctx, result) =>
{
    var r = await result;
    await context.PostAsync(string.Format("Exited pong dialog with result: {0}", r));
    context.Wait(MessageReceivedAsync);
});

(The error isn't a big deal. But it can be quite irritating when someone (like me:-)) starts playing arround with the framework.)

This works:

context.Call<bool>(pongDialog, AfterPongAsync);

private async Task AfterPongAsync(IDialogContext context, IAwaitable<bool> result)
{
    var r = await result;
    await context.PostAsync(string.Format("PONG: Exited pong dialog with result: {0}", r));
    context.Wait(MessageReceivedAsync);
}

Stacktrace:
stacktrace.txt

Version:
"Microsoft.Bcl" version="1.1.10" targetFramework="net46"
"Microsoft.Bcl.Build" version="1.0.21" targetFramework="net46"
"Microsoft.Bot.Builder" version="1.0.0.0" targetFramework="net46"
"Microsoft.Bot.Connector" version="1.0.0.0" targetFramework="net46"

LuisDialog on method never triggers

Hey, I have a very strange issue.
LuisDialog On method never triggers even if I have the good intent.

var builder = require('botbuilder');
var model = 'https://api.projectoxford.ai/luis/v1/application...';
var dialog = new builder.LuisDialog(model);
var cortanaBot = new builder.TextBot();
cortanaBot.add('/', dialog);

dialog.on('builtin.intent.alarm.set_alarm', builder.DialogAction.send('Creating Alarm'));
dialog.onDefault(
  function(a, b) { if('builtin.intent.alarm.set_alarm' == b.intents[0].intent) console.log('ok')}
);
cortanaBot.listenStdin();

When I say 'Set an alarm' it shows 'ok' so the intent is good but it still calls onDefault method.

supported languages?

what nature languages does this framework support beside English? For example, can the bot understand Chinese in text and/or audio?

Node: EntityRecognizer.parseBoolean invalid regex

EntityRecognizer.parseBoolean uses invalid format regexes for yexExp and noExp that cause all values to be recognized as undefined instead of true or false, making Prompts.confirm() unusable.

The regexes use a "\z" character seemingly in an attempt to require an end of line anchor, but this is not valid in JavaScript, so they should use "$" instead.

Publishing simple NodeJs BotConnector example fails

Hi,

I've been eagerly attempting to get a very simple bot to work with the bot framework since I saw the keynote. While getting the bots to work locally is fairly straight forward, I can't seem to get them functioning in the cloud.

I've been playing around with the NodeJs framework - and I basically started mimicking the simple botConnector example: https://github.com/Microsoft/BotBuilder/blob/master/Node/examples/hello-BotConnectorBot/app.js

However, it fails with a 500 and no further information.

From what I can gather it throws an error in the processMessage function and hits the catch statement.

(I tried deploying both to azure, google app engine and heroku - all with the same result)

{
    "error": {
        "code": "ServiceError",
        "message": "*Sorry, CvrBot isn't available right now.*",
        "statusCode": 500
    }
}

I'm really excited to get this up and running :)

Bot Framework emulator download error

I came across the Bot Framework emulator download link from the Bot Builder for Node.js Getting Started page

I downloaded the setup.exe. After running it, an error message "Cannot Start Application: Application download did not succeed" was shown, with the following error details:

PLATFORM VERSION INFO
    Windows             : 10.0.10586.0 (Win32NT)
    Common Language Runtime     : 4.0.30319.42000
    System.Deployment.dll       : 4.6.1038.0 built by: NETFXREL2
    clr.dll             : 4.6.1073.0 built by: NETFXREL3STAGE
    dfdll.dll           : 4.6.1038.0 built by: NETFXREL2
    dfshim.dll          : 10.0.10586.0 (th2_release.151029-1700)

SOURCES
    Deployment url          : http://download.botframework.com/botconnector/tools/emulator/Bot%20Framework%20Emulator.application
                        Server      : Windows-Azure-Blob/1.0 Microsoft-HTTPAPI/2.0
    Deployment Provider url     : file://fuseserver02/public/Intercom/Bot%20Framework%20Emulator/Bot%20Framework%20Emulator.application

ERROR SUMMARY
    Below is a summary of the errors, details of these errors are listed later in the log.
    * Activation of http://download.botframework.com/botconnector/tools/emulator/Bot%20Framework%20Emulator.application resulted in exception. Following failure messages were detected:
        + Downloading file://fuseserver02/public/Intercom/Bot Framework Emulator/Bot Framework Emulator.application did not succeed.
        + The network path was not found.

        + The network path was not found.

        + The network path was not found.


COMPONENT STORE TRANSACTION FAILURE SUMMARY
    No transaction error was detected.

WARNINGS
    There were no warnings during this operation.

OPERATION PROGRESS STATUS
    * [31/3/2016 02:00:07] : Activation of http://download.botframework.com/botconnector/tools/emulator/Bot%20Framework%20Emulator.application has started.

ERROR DETAILS
    Following errors were detected during this operation.
    * [31/3/2016 02:00:10] System.Deployment.Application.DeploymentDownloadException (Unknown subtype)
        - Downloading file://fuseserver02/public/Intercom/Bot Framework Emulator/Bot Framework Emulator.application did not succeed.
        - Source: System.Deployment
        - Stack trace:
            at System.Deployment.Application.SystemNetDownloader.DownloadSingleFile(DownloadQueueItem next)
            at System.Deployment.Application.SystemNetDownloader.DownloadAllFiles()
            at System.Deployment.Application.FileDownloader.Download(SubscriptionState subState)
            at System.Deployment.Application.DownloadManager.DownloadManifestAsRawFile(Uri& sourceUri, String targetPath, IDownloadNotification notification, DownloadOptions options, ServerInformation& serverInformation)
            at System.Deployment.Application.DownloadManager.DownloadDeploymentManifestDirect(SubscriptionStore subStore, Uri& sourceUri, TempFile& tempFile, IDownloadNotification notification, DownloadOptions options, ServerInformation& serverInformation)
            at System.Deployment.Application.DownloadManager.FollowDeploymentProviderUri(SubscriptionStore subStore, AssemblyManifest& deployment, Uri& sourceUri, TempFile& tempFile, IDownloadNotification notification, DownloadOptions options)
            at System.Deployment.Application.DownloadManager.DownloadDeploymentManifestBypass(SubscriptionStore subStore, Uri& sourceUri, TempFile& tempFile, SubscriptionState& subState, IDownloadNotification notification, DownloadOptions options)
            at System.Deployment.Application.ApplicationActivator.PerformDeploymentActivation(Uri activationUri, Boolean isShortcut, String textualSubId, String deploymentProviderUrlFromExtension, BrowserSettings browserSettings, String& errorPageUrl)
            at System.Deployment.Application.ApplicationActivator.ActivateDeploymentWorker(Object state)
        --- Inner Exception ---
        System.Net.WebException
        - The network path was not found.

        - Source: System
        - Stack trace:
            at System.Net.FileWebRequest.EndGetResponse(IAsyncResult asyncResult)
            at System.Deployment.Application.SystemNetDownloader.DownloadSingleFile(DownloadQueueItem next)
        --- Inner Exception ---
        System.Net.WebException
        - The network path was not found.

        - Source: System
        - Stack trace:
            at System.Net.FileWebResponse..ctor(FileWebRequest request, Uri uri, FileAccess access, Boolean asyncHint)
            at System.Net.FileWebRequest.GetResponseCallback(Object state)
        --- Inner Exception ---
        System.IO.IOException
        - The network path was not found.

        - Source: mscorlib
        - Stack trace:
            at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
            at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
            at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)
            at System.Net.FileWebStream..ctor(FileWebRequest request, String path, FileMode mode, FileAccess access, FileShare sharing, Int32 length, Boolean async)
            at System.Net.FileWebResponse..ctor(FileWebRequest request, Uri uri, FileAccess access, Boolean asyncHint)

COMPONENT STORE TRANSACTION DETAILS
    No transaction information is available.


C# - Paste as JSON for LUIS model from endpoint

Hi as suggested by @dandriscoll to go with the WebClient approach & fetch the JSON & map it back to a POCO.

However when trying the same approach as shown in the BUILD demo/session or grabbing the JSON from the example query made from the LUIS portal and then doing a past special to generate a class I get the following error in VS15 Community Edition

screenshot 2016-04-01 19 59 02

And the JSON I was trying to paste special as a class is as follows:

{
  "query": "What time is it for Mikkel at 4 in the afternoon?",
  "intents": [
    {
      "intent": "TimeForUser",
      "score": 0.6357388,
      "actions": [
        {
          "triggered": true,
          "name": "TimeForUser",
          "parameters": [
            {
              "name": "User",
              "required": true,
              "value": [
                {
                  "entity": "mikkel",
                  "type": "User",
                  "score": 0.910984635
                }
              ]
            },
            {
              "name": "Time",
              "required": true,
              "value": [
                {
                  "entity": "4 in the afternoon",
                  "type": "builtin.datetime.time",
                  "resolution": {
                    "time": "T16"
                  }
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "intent": "TimeForEveryone",
      "score": 0.223888189,
      "actions": [
        {
          "triggered": true,
          "name": "TimeForEveryone",
          "parameters": [
            {
              "name": "Time",
              "required": true,
              "value": [
                {
                  "entity": "4 in the afternoon",
                  "type": "builtin.datetime.time",
                  "resolution": {
                    "time": "T16"
                  }
                }
              ]
            }
          ]
        }
      ]
    },
    {
      "intent": "None",
      "score": 0.0346338227,
      "actions": null
    },
    {
      "intent": "RepeatLastTimeAsked",
      "score": 0.0171330366,
      "actions": null
    }
  ],
  "entities": [
    {
      "entity": "mikkel",
      "type": "User",
      "startIndex": 20,
      "endIndex": 25,
      "score": 0.910984635
    },
    {
      "entity": "4 in the afternoon",
      "type": "builtin.datetime.time",
      "startIndex": 30,
      "endIndex": 47,
      "resolution": {
        "time": "T16"
      }
    }
  ]
}

skype-sdk NPM isn't published

You can see this in packages.json:

"dependencies": {
"botkit": "0.0.14",
"restify": "^4.0.4",
"skype-sdk": "file:///C:\Source\skype-sdk.tar.gz"
}

Filtering/Logging bot messages

Sorry if this was already available but couldn't find yet. How can I filter or log the bot messages (node.js) ? Is there a sample project?

"TypeError: Cannot read property 'length' of undefined" with no regex matches

Not sure if this is a bug in the framework or just a lack of proper handling on my part. I'm running the todoBot Node example and getting this error if I just type 'add'. Here's a sample console session:

$ node todoBot/textBot.js 
list
You have no tasks.
help
Available commands are:

* *list* - show all tasks (also *show*, *tasks*)
* *new* [your task] - create a new task (also *save*, *create*, *add*)
* *done* [number of task] - finish a task, you can get the number of a task from *list* (also *delete", *finish*, *remove*)
new test
Created a new task no. 1: test
new
Session Error: Cannot read property 'length' of undefined
events.js:154
      throw er; // Unhandled 'error' event
      ^

TypeError: Cannot read property 'length' of undefined
    at /Users/j.ostrander/open-source/BotBuilder/Node/lib/dialogs/CommandDialog.js:46:44
    at Array.forEach (native)
    at CommandDialog.replyReceived (/Users/j.ostrander/open-source/BotBuilder/Node/lib/dialogs/CommandDialog.js:45:33)
    at Session.routeMessage (/Users/j.ostrander/open-source/BotBuilder/Node/lib/Session.js:174:24)
    at next (/Users/j.ostrander/open-source/BotBuilder/Node/lib/Session.js:30:23)
    at Session.dispatch (/Users/j.ostrander/open-source/BotBuilder/Node/lib/Session.js:40:9)
    at /Users/j.ostrander/open-source/BotBuilder/Node/lib/bots/TextBot.js:108:17
    at /Users/j.ostrander/open-source/BotBuilder/Node/lib/bots/TextBot.js:138:21
    at MemoryStorage.get (/Users/j.ostrander/open-source/BotBuilder/Node/lib/storage/Storage.js:9:13)
    at TextBot.getData (/Users/j.ostrander/open-source/BotBuilder/Node/lib/bots/TextBot.js:132:35)```

Async Timeout On Slack

I'm having some trouble trying to implement a picture description bot for slack, from what I can tell it's an issue with slack timing out if a response isn't received from an async method after a certain amount of time.

I've tested the code below without the DescribeAsync method and it sends a response to slack just fine, however with it, I get absolutely nothing.

   [Serializable]
    public class VisionController : IDialog
    {
        public async Task StartAsync(IDialogContext context)
        {
            context.Wait(MessageReceivedAsync);
        }

        public async Task MessageReceivedAsync(IDialogContext context, IAwaitable<Message> argument)
        {
            var message = await argument;

            var client = new VisionServiceClient("my key goes here");
            var result = await client.DescribeAsync(message.Text);

            await context.PostAsync(result.Description.Captions[0].Text);
            context.Wait(MessageReceivedAsync);
        }
    }

This class is called from

return await Conversation.SendAsync(message, () => new VisionController());

FormFlow stuck after form is finished

I'm testing AnnotatedSandwichBot. I enter values for all prompts until the form is "finished".

After the form reached the finished state the bot seems to always respond with an empty reply.

image

BotConnectorBot and TextBot behaves differently with dialogs

Since I'm sitting on a mac, the way I debug my code is by runningt a textbot locally. To test everything out, I'm building a simple conversational bot, which goes through a simple waterfall model.

I have a three step waterfall model which can exit at multiple stages. The way I do this is by calling session.endDialog() if the exit criteria is met. If it isn't met, I call session.send('Current state') and then I present a new prompt (builder.Prompts.choice(session, "Do you want me to?)).

This works just fine locally - however, I can't seem to get it to work as intended when it's online. To me it seems like the botConnectorBot exists the dialog when send() is called. Is this correct? And if that is the case - how would I go about presenting the user with intermediary data? (I could of course just include it in the prompt, but they can get quite hefty then).

Furthermore, when I couple my botConnectorbot with slack it behaves weirdly. It triggers the one match I've enabled even though there is no matching text:

Text bot

screen shot 2016-04-01 at 12 21 59

Bot Connector Bot through slack

screen shot 2016-04-01 at 12 23 21

Restart and erase existing dialog

After user A finishes (aka)

                    .AddRemainingFields()
                    .Message("Thanks {FullName}!")
                    .Build();

is there a way for me to delete the history so it goes back to Hi! I'm dummybot. Say "hi" if you'd like to chat?
so user B can start from the beginning?
Currently I have to refresh the server.

FormDialog with initial state does not skip populated fields

Version: master (688932a)
Expected behavior: The step is skipped.

When you launch a FormDialog, you can optionally pass in an instance of your state. If you do that, any step for filling a field is skipped if that field has a value - documentation

Actual: The step is not skipped. The value is known by the bot. It responds like this:

Please enter favorite color (current choice: blue)

Repro:

[BotAuthentication]
public class MessagesController : ApiController
{

    [Serializable]
    public class SampleQuestion
    {
        public string FavoriteColor;
        public string FavoritePizza;

        public static IForm<SampleQuestion> BuildForm()
        {
            return new FormBuilder<SampleQuestion>().Build();
        }
    }

    [Serializable]
    class SampleQuestionDialog : IDialog
    {
        async Task IDialog.StartAsync(IDialogContext context)
        {
            var question = new SampleQuestion();
            // Pre-populate a field
            question.FavoriteColor = "blue";
            context.Call<SampleQuestion>(new FormDialog<SampleQuestion>(question), OnSampleQuestionAnswered);
        }
        public async Task OnSampleQuestionAnswered(IDialogContext context, IAwaitable<SampleQuestion> sampleQuestion)
        {
            var result = await sampleQuestion;
        }
    }

    public async Task<Message> Post([FromBody]Message message)
    {
        return await Conversation.SendAsync(message, () => new SampleQuestionDialog());
    }
}

Issue with Web Chat component

Not sure if this is the right place to post... but here goes...

First of all the SDK is excellent, great work everyone involved.

My bot works in the emulator, but I have come across a snag when I try to embed a web chat onto my page.
As far as I can see, I have configured everything appropriately, enabled the web chat channel in the bot portal, but when I use the web chat, the bot is not responding.

see example

Note this happens inside an iframe and if i navigate to the URL directly.
Looking inside fiddler I can see that I am getting a 403 forbidden from the endpoint https://webchat.botframework.com/api/conversations. (error detail:
"Missing token or secret").

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.