feat: 完成ai生成
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
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; }
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
using System.ComponentModel;
|
||||
using System.Text.Json.Serialization;
|
||||
using Microsoft.SemanticKernel;
|
||||
|
||||
namespace Yi.Framework.Stock.Domain.Managers.Plugins;
|
||||
|
||||
public class StockPlugins
|
||||
{
|
||||
[KernelFunction("save_stocks"), Description("生成并且保存多个股票记录")]
|
||||
public async Task<string> SaveAsync(List<StockModel> stockModels)
|
||||
{
|
||||
return "成功";
|
||||
}
|
||||
}
|
||||
|
||||
public class StockModel
|
||||
{
|
||||
[JsonPropertyName("id")]
|
||||
public int Id { get; set; }
|
||||
|
||||
[JsonPropertyName("name")]
|
||||
public string Name { get; set; }
|
||||
|
||||
[JsonPropertyName("is_on")]
|
||||
public bool? IsOn { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user