我正在尝试识别与Intent命令关联的实体“数字”。
我使用Core Bot示例,并让类名称保持不变。 https://github.com/microsoft/BotBuilder-Samples/tree/master/samples/csharp_dotnetcore/13.core-bot
我在flightbooking.cs中添加了“数字”实体
// Built-in entities
public DateTimeSpec[] datetime;
public double[] number;
我在flightbookingex.cs中添加了这个
public string Order_Number
=> Entities.number.ToString();
我在这里创建了一个类:Order_Details.cs
namespace microsoft.BotBuilderSamples
{
public class Order_Details
{
public string Order_Number { get; set; }
}
}
当我想在maindialog.cs中检索结果时
case FlightBooking.Intent.commande:
var commandemessagetext = "Voici le bon de commande";
var orderDetails = new Order_Details()
{
// Get destination and origin from the composite entities arrays.
Order_Number = luisResult.Order_Number,};
var travelDateMsg = { result.Order_Number };
它说Cannot initialize an implicitly-typed variable with an array initializer
和The name 'result' does not exist in the current context
我没有找到另一种方法。我想在“案例FlightBooking.Intent.commande”中显示travelDateMsg的结果。在核心bot示例中,它显示在另一个stepcontext中。
我也尝试了以下代码,但是以某种方式无法正常工作。
case FlightBooking.Intent.commande:
var commandemessagetext = "Here the order";
var order_count= luisResult.Entities;
var messageTexto = $"you have ordered {order_count}";
var message = MessageFactory.Text(messageTexto,messageTexto,InputHints.IgnoringInput);
await stepContext.Context.SendactivityAsync(message,cancellationToken);
结果是"you have ordered microsoft.BotBuilderSamples.FlightBooking+_Entities"
有没有一种简单的方法可以在与检测意图的代码相同的代码块中返回某个意图的值?
非常感谢您对此有任何建议