You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
kev/Drawer/AI/Plugin/FormRequestPlugin.cs

26 lines
1.1 KiB
C#

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

using System.ComponentModel;
using AI.Interface;
using Microsoft.SemanticKernel;
namespace AI.Plugin
{
/// <summary>
/// 表单请求插件AI 需要用户填写参数时调用此插件,在聊天中插入对应表单。
/// </summary>
public class FormRequestPlugin(IFormRequestNotifier notifier)
{
private readonly IFormRequestNotifier _notifier = notifier;
[KernelFunction]
[Description("当需要用户填写表单(如文件路径、参数等)时调用。调用后界面会自动弹出表单供用户填写。")]
[return: Description("通知结果,告知表单是否已发送给用户")]
public string ShowForm(
[Description("表单 ID。可选值gridding-load-xyz散点文件加载卡片自动完成文件选择、数据预览和列头匹配gridding-parameters网格化参数设置卡片自动加载参数用户确认后点击生成完成成图")]
string formId)
{
_notifier.RequestForm(formId);
return $"已向用户展示表单,等待用户填写并提交。";
}
}
}