Код: Выделить всё
public sealed class WeatherFunction : AIFunction
{
public override AIFunctionMetadata Metadata { get; }
public WeatherFunction()
{
Metadata = new AIFunctionMetadata("getWeather")
{
Parameters =
[
new AIFunctionParameterMetadata("location")
{
Description = "The location to get the weather for",
IsRequired = true,
ParameterType = typeof(string),
},
]
};
}
protected override Task InvokeCoreAsync(IEnumerable arguments, CancellationToken cancellationToken)
{
return Task.FromResult("It's raining");
}
}
Подробнее здесь: https://stackoverflow.com/questions/793 ... adata-when
Мобильная версия