cxuesong / botbuilder.standard Goto Github PK
View Code? Open in Web Editor NEWAn unofficial CoreCLR targeted .NET Standard ported version of BotBuilder.
Home Page: https://github.com/CXuesong/BotBuilder.Standard/wiki
License: MIT License
An unofficial CoreCLR targeted .NET Standard ported version of BotBuilder.
Home Page: https://github.com/CXuesong/BotBuilder.Standard/wiki
License: MIT License
Scorable is not fired
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;
}
}
builder.Register(c => new SampleScorable(c.Resolve(), c.Resolve(), c.Resolve()))
.As<IScorable<IActivity, double>>()
.InstancePerLifetimeScope();
User Input on Bot: Help
Bot Response: ^^
Continue in current Dialog and not interrupted
'Microsoft.Bot.Builder.Dialogs.IDialogContext' does not contain a definition for 'Done'
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);
[...]
}
retrieve filter object on ExecutedCatalogFilterAsync
Exception: 'Microsoft.Bot.Builder.Dialogs.IDialogContext' does not contain a definition for 'Done'
Same issue in emulator as #3694
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.
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);
}
After responding to the confirm prompt, the ResumeAfter function should execute.
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.