25 lines
904 B
C#
25 lines
904 B
C#
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Threading.Tasks;
|
|
using LinkToolAddin.host.llm.entity;
|
|
using LinkToolAddin.resource;
|
|
using LinkToolAddin.server;
|
|
using ModelContextProtocol.Server;
|
|
using Newtonsoft.Json;
|
|
|
|
namespace LinkToolAddin.client.tool;
|
|
|
|
public class KnowledgeBase
|
|
{
|
|
[McpServerTool, Description("可以查询ArcGIS Pro的帮助文档获取关于地理处理工具使用参数的说明")]
|
|
public static async Task<JsonRpcResultEntity> QueryArcgisHelpDoc(string query)
|
|
{
|
|
DocDb docDb = new DocDb("sk-db177155677e438f832860e7f4da6afc", DocDb.KnowledgeBase.ArcGISProHelpDoc);
|
|
KnowledgeResult knowledgeResult = await docDb.Retrieve(query);
|
|
JsonRpcResultEntity result = new JsonRpcSuccessEntity()
|
|
{
|
|
Result = JsonConvert.SerializeObject(knowledgeResult.ChunkList),
|
|
};
|
|
return result;
|
|
}
|
|
} |