2025-05-13 16:45:19 +00:00
|
|
|
using BotSharp.Abstraction.Functions;
|
|
|
|
|
|
2025-05-16 03:59:57 +00:00
|
|
|
namespace BotSharp.Core.Demo.Functions;
|
2025-05-13 16:45:19 +00:00
|
|
|
|
|
|
|
|
public class GetWeatherFn : IFunctionCallback
|
|
|
|
|
{
|
|
|
|
|
private readonly IServiceProvider _services;
|
|
|
|
|
|
|
|
|
|
public GetWeatherFn(IServiceProvider services)
|
|
|
|
|
{
|
|
|
|
|
_services = services;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public string Name => "get_weather";
|
|
|
|
|
public string Indication => "Querying weather";
|
|
|
|
|
|
|
|
|
|
public async Task<bool> Execute(RoleDialogModel message)
|
|
|
|
|
{
|
2025-05-16 04:02:38 +00:00
|
|
|
message.Content = $"It is a sunny day!";
|
2025-06-24 02:43:25 +00:00
|
|
|
message.StopCompletion = false;
|
2025-05-13 16:45:19 +00:00
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|