mirror of
https://gitee.com/ccnetcore/Yi
synced 2026-04-08 10:16:37 +08:00
25 lines
600 B
C#
25 lines
600 B
C#
using System.ComponentModel;
|
|
using System.Text.Json.Serialization;
|
|
using Microsoft.SemanticKernel;
|
|
|
|
namespace Yi.Framework.Stock.Domain.Managers.Plugins;
|
|
|
|
public class NewsPlugins
|
|
{
|
|
[KernelFunction("save_news"), Description("生成并且保存一个新闻")]
|
|
public async Task<string> SaveAsync(NewModel news)
|
|
{
|
|
return "成功";
|
|
}
|
|
}
|
|
|
|
public class NewModel
|
|
{
|
|
[JsonPropertyName("title")]
|
|
[DisplayName("新闻标题")]
|
|
public string Title { get; set; }
|
|
|
|
[JsonPropertyName("content")]
|
|
[DisplayName("新闻内容")]
|
|
public string? Content { get; set; }
|
|
} |