C# 使用bot框架的聊天机器人中的C-自动建议
我正在尝试使用C中的Bot框架实现chatbot中弹出的自动问题建议。如何将多个自动问题建议保持在一行中。当我进入hitext字段时,它会给出多个建议,如hello,hey there,hi等,然后单击suggestion,它会自动完成,应该像Google suggestion一样 我是用C实现的,但它给出了多个答案的建议C# 使用bot框架的聊天机器人中的C-自动建议,c#,botframework,azure-bot-service,C#,Botframework,Azure Bot Service,我正在尝试使用C中的Bot框架实现chatbot中弹出的自动问题建议。如何将多个自动问题建议保持在一行中。当我进入hitext字段时,它会给出多个建议,如hello,hey there,hi等,然后单击suggestion,它会自动完成,应该像Google suggestion一样 我是用C实现的,但它给出了多个答案的建议 [QnAMaker("set yout subscription key here", "set your kbid here", "I don't understand t
[QnAMaker("set yout subscription key here", "set your kbid here", "I don't understand this right now! Try another query!", 0.50, 3)]
public class QnABotWithCustomAnswer : QnAMakerDialog
{
protected override async Task QnAFeedbackStepAsync(IDialogContext context, QnAMakerResults qnaMakerResults)
{
// responding with the top answer when score is above some threshold
if (qnaMakerResults.Answers.Count > 0 && qnaMakerResults.Answers.FirstOrDefault().Score > 0.75)
{
await context.PostAsync(qnaMakerResults.Answers.FirstOrDefault().Answer);
}
else
{
await base.QnAFeedbackStepAsync(context, qnaMakerResults);
}
}
}
请帮帮我
它给出了多个答案的建议
在您的代码中,我们可以发现您将top属性的答案数设置为3,如果您希望QnAMaker对话框返回top 1答案,您可以将top属性设置为1
以下是QnAMakerAttribute的定义,您可以查看它并了解每个参数的详细信息:
// Summary:
// Construct the QnA Knowledgebase information.
//
// Parameters:
// knowledgebaseId:
// The QnA Knowledgebase ID.
//
// defaultMessage:
// The default message returned when no match found.
//
// scoreThreshold:
// The threshold for answer score.
//
// top:
// The number of answers to return.
public QnAMakerAttribute(string authKey, string knowledgebaseId, string defaultMessage = null, double scoreThreshold = 0.3, int top = 1, string endpointHostName = null);
// Summary:
// Construct the QnA Knowledgebase information.
//
// Parameters:
// knowledgebaseId:
// The QnA Knowledgebase ID.
//
// defaultMessage:
// The default message returned when no match found.
//
// scoreThreshold:
// The threshold for answer score.
//
// top:
// The number of answers to return.
public QnAMakerAttribute(string authKey, string knowledgebaseId, string defaultMessage = null, double scoreThreshold = 0.3, int top = 1, string endpointHostName = null);