富卡附件未显示在网络聊天或Skype上,但在模拟器上显示正常.附件包含正确的数据和属性,如果我使用ContentType + ContentURL,则工作正常.但如果我使用丰富的卡附件,它们就不会出现在网络聊天或Skype上.这是我的代码.请帮忙.
Message reply = context.MakeMessage();
var actions = new List<Microsoft.Bot.Connector.Action>();
actions.Add(new Microsoft.Bot.Connector.Action
{
Title = $"I like it",
Message = $"I like it message"
});
actions.Add(new Microsoft.Bot.Connector.Action
{
Title = $"Show me more",
Message = $"Show me more message"
});
reply.Attachments = new List<Attachment>();
reply.Attachments.Add(new Attachment()
{
Title = p.Title,
TitleLink = p.DetailPageURL,
ThumbnailUrl = p.MediumImage,
Text = p.Title,
Actions = actions,
FallbackText ="The message attachment is not rendering for: " + p.Title
});
await context.PostAsync(reply);
context.Wait(MessageReceived);
Run Code Online (Sandbox Code Playgroud) 我正在尝试使用Microsoft Bot Framework和一个简单的Q/A场景.我按照" 连接器入门"页面上的步骤进行操作.但是,在我注册我的机器人并上传它之后,当我在机器人框架网站上测试它时,我得到一个方法不允许的错误.我可以在模拟器中运行机器人就好了.我知道这是一个405错误,但我不明白的是它试图做什么.有人知道吗?
我的基于僵尸框架的机器人非常好用.但是当我在一段时间不活动(比如说一天)后第一次与机器人交互时,机器人似乎需要很长时间(大约10-45秒)才能发回第一个回复.在回复之后,响应时间再次相当不错.
对我来说,似乎后端服务进入某种睡眠模式,第一个请求唤醒它.
有没有办法影响这种行为?我担心用户的初始响应时间很长.
谢谢你的帮助.
我现在正在使用带有ASP.NET的Microsoft Bot Framework的第一个机器人.
在使用bot模拟器进行手动测试后,我正在寻找为bot创建自动测试的最佳方法.
考虑到两个问题:
在我的消息控制器,我想检查某个对话框是否是堆栈的传入消息上之前将其分派到一个对话框,这样我就可以抑制某些条件行为.我尝试IDialogStack按照这个答案解决,像这样:
public async Task<HttpResponseMessage> Post([FromBody] Activity incomingMessage)
{
try
{
if (incomingMessage.Type == ActivityTypes.Message)
{
using (var scope = DialogModule.BeginLifetimeScope(Conversation.Container, activity))
{
var stack = scope.Resolve<IDialogStack>();
}
...
Run Code Online (Sandbox Code Playgroud)
这是在我的Global.asax中注册的模块:
private void RegisterBotModules()
{
var builder = new ContainerBuilder();
builder.RegisterModule(new DialogModule());
builder.RegisterModule(new ReflectionSurrogateModule());
builder.RegisterModule(new DialogModule_MakeRoot());
builder.RegisterModule<GlobalMessageHandler>();
builder.RegisterModule(new AzureModule(Assembly.GetExecutingAssembly()));
var store = new TableBotDataStore(/*connection string*/);
builder.Register(c => store)
.Keyed<IBotDataStore<BotData>>(AzureModule.Key_DataStore)
.AsSelf()
.SingleInstance();
builder.Register(c => new CachingBotDataStore(store, CachingBotDataStoreConsistencyPolicy.ETagBasedConsistency))
.As<IBotDataStore<BotData>>()
.AsSelf()
.InstancePerLifetimeScope();
builder.Update(Conversation.Container);
var config = GlobalConfiguration.Configuration;
config.DependencyResolver = new AutofacWebApiDependencyResolver(Conversation.Container); …Run Code Online (Sandbox Code Playgroud) 谁能解释一下microsoft bot连接器中的标准/高级频道是什么?
是Skype,Skype for business,Slack,Kik - 标准/付费频道?
我正在为我自己的目的,为Bot Framework V4(使用LUIS)破解GitHub'CoreBot'示例代码,并且在响应和瀑布对话框步骤的执行方式上遇到了麻烦。
我有一个顶级对话框。我的期望是,该对话框基于输入对LUIS进行初始调用,并基于该输入路由到其他对话框。目前,只能问候机器人并报告危险。我的对话框设置如下(忽略BookingDialog,它是示例的一部分)。
public MainDialog(IConfiguration configuration, ILogger<MainDialog> logger)
: base(nameof(MainDialog))
{
Configuration = configuration;
Logger = logger;
AddDialog(new TextPrompt(nameof(TextPrompt)));
AddDialog(new BookingDialog());
AddDialog(new HazardDialog());
AddDialog(new WaterfallDialog(nameof(WaterfallDialog), new WaterfallStep[]
{
MainStepAsync,
EndOfMainDialogAsync
}));
// The initial child Dialog to run.
InitialDialogId = nameof(WaterfallDialog);
}
Run Code Online (Sandbox Code Playgroud)
我的期望是MainStepAsync被执行,并运行以下命令:
private async Task<DialogTurnResult> MainStepAsync(WaterfallStepContext stepContext, CancellationToken cancellationToken)
{
CoreBot.StorageLogging.LogToTableAsync($"Main step entered. I am contacting LUIS to determine the intent");
string what_i_got = await LuisHelper.ExecuteMyLuisQuery(Configuration, Logger, stepContext.Context, cancellationToken);
CoreBot.StorageLogging.LogToTableAsync($"LUIS intent matched: {what_i_got}");
//await stepContext.PromptAsync(nameof(TextPrompt), new PromptOptions { …Run Code Online (Sandbox Code Playgroud) c# botframework azure-language-understanding azure-bot-service
我目前正在尝试使用 Microsoft 的 Bot Framework 编写聊天机器人。我想使用选择提示,但它不会等待我/用户选择一个选项。甚至这里的示例代码都不适合我。请参阅此工作示例:
var restify = require('restify');
var builder = require('botbuilder');
var botbuilder_azure = require("botbuilder-azure");
// Setup Restify Server
var server = restify.createServer();
server.listen(process.env.port || process.env.PORT || 3978, function () {
console.log('%s listening to %s', server.name, server.url);
});
// Create chat connector for communicating with the Bot Framework Service
var connector = new builder.ChatConnector({
appId: process.env.MicrosoftAppId,
appPassword: process.env.MicrosoftAppPassword,
openIdMetadata: process.env.BotOpenIdMetadata
});
// Listen for messages from users
server.post('/api/messages', connector.listen());
var bot = new builder.UniversalBot(connector);
bot.set('storage', …Run Code Online (Sandbox Code Playgroud) 如何在上一个 BotChat 对话中禁用输入/提交按钮操作 - Microsoft Bot Framework (C#) 中的 AdaptiveCards
为了审计/历史目的,我必须在 CosmosDB 中记录用户与机器人的对话。在使用 .Net 的 V3 中,我使用的是表记录器模块,如下面的代码。
builder.RegisterModule(new TableLoggerModule(account, chatHistoryTableName));
现在我们正在 NodeJS 中将机器人升级/重写到 V4。请指导是否有类似的方法可用于 NodeJS 中的 V4 来保存整个对话?
botframework ×10
c# ×4
node.js ×2
azure ×1
azure-language-understanding ×1
botconnector ×1
bots ×1
button ×1
chatbot ×1
prompt ×1
skype ×1
skype-bots ×1
testing ×1
web-chat ×1