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.
46 lines
1.7 KiB
C#
46 lines
1.7 KiB
C#
using System.ComponentModel;
|
|
using System.Threading.Tasks;
|
|
using Microsoft.SemanticKernel;
|
|
using AI.AgentIntegration;
|
|
|
|
namespace AI.Plugin
|
|
{
|
|
/// <summary>
|
|
/// 导入相关功能插件(井点 / 曲线等从文件导入)
|
|
/// </summary>
|
|
/// <param name="controller">应用程序控制器实例</param>
|
|
public class ImportPlugin(IAppController controller)
|
|
{
|
|
private readonly IAppController controller = controller;
|
|
|
|
/// <summary>
|
|
/// 从指定路径导入井点数据
|
|
/// </summary>
|
|
/// <param name="path">井点数据文件路径</param>
|
|
/// <returns>成功或失败消息</returns>
|
|
[KernelFunction]
|
|
[Description("从指定路径导入井点数据")]
|
|
public async Task<string> ImportWellPointsAsync(
|
|
[Description("井点数据文件路径")] string path)
|
|
{
|
|
var result = await controller.ExecuteAsync(AppAction.CreateImportWellPoints(path));
|
|
return result.Success ? "井点导入成功" : result.Message ?? "井点导入失败";
|
|
}
|
|
|
|
/// <summary>
|
|
/// 从指定路径导入井曲线数据
|
|
/// </summary>
|
|
/// <param name="path">井曲线数据文件路径</param>
|
|
/// <returns>成功或失败消息</returns>
|
|
[KernelFunction]
|
|
[Description("从指定路径导入井曲线数据")]
|
|
public async Task<string> ImportWellCurvesAsync(
|
|
[Description("井曲线数据文件路径")] string path)
|
|
{
|
|
var result = await controller.ExecuteAsync(AppAction.CreateImportWellCurves(path));
|
|
return result.Success ? "曲线导入成功" : result.Message ?? "曲线导入失败";
|
|
}
|
|
}
|
|
}
|
|
|