我注意到Direct Line请求网址是这样的:https://localhost:8011/api/在文档中.什么应该替换它?
我已经从botbuilderExamples文件夹部署了一个todoBot示例项目.我在My bots部分创建了一个机器人,结束点是:http://www.bigluntan.com:3978/api/messages.我在Test connection to your bot部分测试过,当我输入内容并发送它时,它正在工作.现在,我想试试Direct Line.所以我添加了Direct Line to Channels.但最困惑的部分是,如何调用此Direct Line api,导致终点不同于我的机器人的终点.
我正在研究机器人框架技术,在一个项目中,我实现了Hero卡和缩略图卡的代码.
在我添加了上述概念的代码后,接下来我在Bot Framework Channel Emulator中测试了它的工作正常并成功显示了Hero卡.但是在我将代码发布到azure并将skype频道添加到我的机器人之后,现在我开始与我的机器人聊天以显示英雄卡片图像,但它没有显示任何英雄卡片图像,如下图所示.

类似地,我实现了Form Flow Concept它在Bot Emulator中工作正常,但它不能在skype频道中工作,它显示与上图相同的问题.
请告诉我们如何解决此问题.我认为Skype中可能存在显示Hero Card和Form Flow对话框的错误.
普拉迪普
任何人都可以解释我什么时候使用Dialogs比FormFlow更好?在我的情况下,我没有提供很多选项供用户选择(比如Sandwich bot示例),但我会有很多逻辑.例如:如果用户说了什么,我正在通过LUIS模型分析他的答案,然后调用一个特定的方法.根据用户说的我需要调用不同的方法.
我刚刚开始使用Direct Line API(1.1),我看到它不会让你知道是否在Hero Card或Button中显示了对话.
{
"id": "fBPDq9JSeL|000000000000000004",
"conversationId": "fBPDq9JSeL",
"created": "2016-11-28T20:22:20.6035604Z",
"from": "portosegurobot",
"text": "Health For Pets\n\nNossa missão é proporcionar a cães e gatos uma vida mais saudável e feliz.\n\nAcesse e saiba mais\n\n(Acesse) https://health4pet.com.br/",
"images": [],
"attachments": [],
"eTag": "W/\"datetime'2016-11-28T20%3A22%3A21.3990939Z'\""
}
上面的代码显示(在模拟器中)带有按钮的英雄卡(卡片动作).Direct Line API不会标记出来吗?有办法吗?
c# chatbot botframework direct-line-botframework botconnector
这种例外不断抛出.这是因为我将botframework更新为3.5.3.
代码:
MessagesController:
await Conversation.SendAsync(activity, () => new DefaultDialog());
Run Code Online (Sandbox Code Playgroud)
比我的DefaultDialog:
private async Task MessageReceivedAsync(IDialogContext context, IAwaitable<IMessageActivity> argument)
{
var msg = await argument;
await Helper.CallMenu(context, msg);
Run Code Online (Sandbox Code Playgroud)
在CallMenu函数中:
internal static async Task CallMenu(IDialogContext context, IMessageActivity msg)
{
await MenuFirstPart(context, msg);
Run Code Online (Sandbox Code Playgroud)
在MenuFirstPart函数中:
internal static async Task MenuFirstPart(IDialogContext context, IMessageActivity msg)
{
await context.PostAsync("I can assist you with : ");
msg.AttachmentLayout = AttachmentLayoutTypes.Carousel;
msg.Attachments = new List<Attachment>();
ThumbnailCard thumbnailCard = new ThumbnailCard()
{
Buttons = new List<CardAction>
{
new CardAction ()
{
Value …Run Code Online (Sandbox Code Playgroud) 我正在尝试将emojis添加到机器人的网络聊天响应中.我试过降价但这似乎不起作用.在WebChat的响应中包含表情符号的最佳方法是什么?
我正在使用Microsoft bot框架创建一个机器人来询问用户然后理解答案.在bot框架中使用FormFlow API对用户进行询问并检索答案.以下是表单流的代码:
public enum Genders { none, Male, Female, Other};
[Serializable]
public class RegisterPatientForm
{
[Prompt("What is the patient`s name?")]
public string person_name;
[Prompt("What is the patients gender? {||}")]
public Genders gender;
[Prompt("What is the patients phone number?")]
[Pattern(@"(<Undefined control sequence>\d)?\s*\d{3}(-|\s*)\d{4}")]
public string phone_number;
[Prompt("What is the patients Date of birth?")]
public DateTime DOB;
[Prompt("What is the patients CNIC number?")]
public string cnic;
public static IForm<RegisterPatientForm> BuildForm()
{
OnCompletionAsyncDelegate<RegisterPatientForm> processHotelsSearch = async (context, state) =>
{
await context.PostAsync($"Patient {state.person_name} …Run Code Online (Sandbox Code Playgroud) 我的应用程序说我一直收到异常
Exception: Response status code does not indicate success: 403 (Quota Exceeded).
Run Code Online (Sandbox Code Playgroud)
这是否意味着我们每月只能在LUIS上每次应用1000次点击?
在此例外情况下,欢迎任何其他理由.
<!DOCTYPE html>
<html>
<head>
<link href="https://cdn.botframework.com/botframework-webchat/latest/botchat.css" rel="stylesheet" />
</head>
<body>
<div id="bot"/>
<script src="https://cdn.botframework.com/botframework-webchat/latest/botchat.js"></script>
<script>
BotChat.App({
directLine: { secret: direct_line_secret },
user: { id: 'userid' },
bot: { id: 'botid' },
resize: 'detect'
}, document.getElementById("bot"));
</script>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
我有这样的代码嵌入机器人的使用直接行API,而不是通常的iframe实时聊天,但是当我把我的directline私有密钥,机器人占据整个网页.我需要它显示在网页的右下角,当用户点击它时弹出为生活聊天.请有人指导我实现这一目标.谢谢
botframework ×10
c# ×3
azure-language-understanding ×2
botconnector ×2
formflow ×2
node.js ×2
azure ×1
botbuilder ×1
chatbot ×1
dialog ×1