BotSharp/tests/BotSharp.Plugin.PizzaBot/Functions/GetPizzaPricesFn.cs

20 lines
520 B
C#
Raw Normal View History

2023-08-30 22:40:45 +00:00
using BotSharp.Abstraction.Conversations.Models;
2023-08-30 23:29:01 +00:00
using System.Text.Json;
2023-08-30 22:40:45 +00:00
namespace BotSharp.Plugin.PizzaBot.Functions;
public class GetPizzaPricesFn : IFunctionCallback
{
public string Name => "get_pizza_price";
public async Task<bool> Execute(RoleDialogModel message)
{
2023-08-30 23:29:01 +00:00
message.ExecutionData = new
{
cheese = "3.5"
};
2023-08-30 22:40:45 +00:00
message.ExecutionResult = "Pepperoni Pizza: $3.5/slice, Cheese Pizza: $2.5/slice, Margherita Pizza: $3.0/slice";
return true;
}
}