diff --git a/ui/dockpane/TestDockpane.xaml b/ui/dockpane/TestDockpane.xaml
index fd7d8c8..53c1501 100644
--- a/ui/dockpane/TestDockpane.xaml
+++ b/ui/dockpane/TestDockpane.xaml
@@ -20,7 +20,9 @@
-
+
+
+
@@ -31,9 +33,11 @@
-
+
-
+
+
+
\ No newline at end of file
diff --git a/ui/dockpane/TestDockpane.xaml.cs b/ui/dockpane/TestDockpane.xaml.cs
index abf8b4a..da572db 100644
--- a/ui/dockpane/TestDockpane.xaml.cs
+++ b/ui/dockpane/TestDockpane.xaml.cs
@@ -1,12 +1,18 @@
-using System.Collections.Generic;
+using System;
+using System.Collections.Generic;
using System.Linq;
+using System.Reflection;
using System.Text;
+using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
+using System.Xml.Linq;
using LinkToolAddin.client;
using LinkToolAddin.host;
using LinkToolAddin.host.llm;
using LinkToolAddin.host.llm.entity;
+using LinkToolAddin.host.mcp;
+using LinkToolAddin.host.prompt;
using LinkToolAddin.message;
using LinkToolAddin.resource;
using LinkToolAddin.server;
@@ -231,5 +237,42 @@ namespace LinkToolAddin.ui.dockpane
{
Request_Bailian_Stream_Test();
}
+
+ private void StopConversation_OnClick(object sender, RoutedEventArgs e)
+ {
+ Gateway.StopConversation();
+ }
+
+ private async void TestArcGisTool_OnClick(object sender, RoutedEventArgs e)
+ {
+ string xmlStr =
+ "\nArcGisPro:ArcGisProTool\n{\"toolName\": \"Buffer\", \"toolParams\": [\"D:\\\\01_Project\\\\20250305_LinkTool\\\\20250420_AiDemoProject\\\\20250420_AiDemoProject.gdb\\\\LandUse_2005_Copy\", \"D:\\\\01_Project\\\\20250305_LinkTool\\\\20250420_AiDemoProject\\\\20250420_AiDemoProject.gdb\\\\LandUse_2005_Buffer30m\", \"30 Meters\", \"NONE\", \"ROUND\", \"ALL\"]}\n";
+ XElement toolUse = XElement.Parse(xmlStr);
+ string fullToolName = toolUse.Element("name")?.Value;
+ string toolArgs = toolUse.Element("arguments")?.Value;
+ Dictionary toolParams = JsonConvert.DeserializeObject>(toolArgs);
+ string serverName = fullToolName.Contains(":") ? fullToolName.Split(':')[0] : fullToolName;
+ string toolName = fullToolName.Contains(":") ? fullToolName.Split(':')[1] : fullToolName;
+ McpServerList mcpServerList = new McpServerList();
+ McpServer mcpServer = mcpServerList.GetServer(serverName);
+ if (mcpServer is InnerMcpServer)
+ {
+ Type type = Type.GetType("LinkToolAddin.client.tool." + serverName);
+ var toolParamsValues = toolParams.Values.ToArray();
+ MethodInfo method = type.GetMethod(toolName, BindingFlags.Public | BindingFlags.Static);
+ var task = method.Invoke(null, toolParams.Values.ToArray()) as Task;
+ JsonRpcResultEntity innerResult = await task;
+ MessageListItem toolMessageItem = new ToolMessageItem
+ {
+ toolName = toolName,
+ toolParams = toolParams,
+ type = MessageType.TOOL_MESSAGE,
+ status = "fail",
+ content = JsonConvert.SerializeObject(innerResult),
+ id = "1test"
+ };
+ AddReply(toolMessageItem);
+ }
+ }
}
}