添加国外大模型
This commit is contained in:
parent
9b1f479425
commit
4cd81dfc2e
@ -239,8 +239,8 @@ public class Gateway
|
||||
public static async void SendMessageStream(string message, string model, string gdbPath, Action<MessageListItem> callback)
|
||||
{
|
||||
Llm modelObj = new Bailian();
|
||||
List<string> bailianModels = [];
|
||||
List<string> dmxModels = ["gpt-4o","claude-sonnet-4-20250514-thinking","claude-sonnet-4-20250514","grok-3-reasoner","gemini-2.5-pro"];
|
||||
List<string> bailianModels = ["qwen3-235b-a22b","qwen3-32b","qwq-32b","qwen-max-latest","deepseek-r1","deepseek-r1-0528","deepseek-r1-distill-qwen-32b","deepseek-r1-distill-llama-70b","deepseek-v3"];
|
||||
List<string> dmxModels = ["gpt-4o","claude-sonnet-4-20250514-thinking","claude-sonnet-4-20250514","grok-3-reasoner","gemini-2.5-pro","o4-mini"];
|
||||
if (bailianModels.Contains(model))
|
||||
{
|
||||
modelObj = new Bailian
|
||||
@ -312,6 +312,7 @@ public class Gateway
|
||||
// MessageBox.Show(ex.Message,"获取MCP列表失败");
|
||||
}
|
||||
goOn = true;
|
||||
long accTokens = 0;
|
||||
string toolPattern = "<tool_use>([\\s\\S]*?)<name>([\\s\\S]*?)<\\/name>([\\s\\S]*?)<arguments>([\\s\\S]*?)<\\/arguments>([\\s\\S]*?)<\\/tool_use>";
|
||||
string promptPattern = "<prompt>([\\s\\S]*?)<name>([\\s\\S]*?)<\\/name>([\\s\\S]*?)<arguments>([\\s\\S]*?)<\\/arguments>([\\s\\S]*?)<\\/prompt>";
|
||||
McpServerList mcpServerList = new McpServerList();
|
||||
@ -868,7 +869,7 @@ public class Gateway
|
||||
{
|
||||
log.Error(e.Message);
|
||||
failedMcp.Add(i);
|
||||
failedMcpString.Add(mcpServerList.GetAllServerNames()[i]);
|
||||
failedMcpString.Add(mcpServerList.GetAllServerNames()[i-1]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -49,41 +49,41 @@ public class McpServerList
|
||||
"F:\\secondsemester\\linktool\\test\\LinkTool0607\\LinkTool0607.gdb"
|
||||
}
|
||||
});
|
||||
servers.Add("fetch", new StdioMcpServer()
|
||||
{
|
||||
Name = "fetch",
|
||||
Type = "stdio",
|
||||
Command = "uvx",
|
||||
Args = new List<string>()
|
||||
{
|
||||
"mcp-server-fetch"
|
||||
}
|
||||
});
|
||||
servers.Add("bing-search", new StdioMcpServer()
|
||||
{
|
||||
Name = "bing-search",
|
||||
Type = "stdio",
|
||||
Command = "npx",
|
||||
Args = new List<string>()
|
||||
{
|
||||
"bing-cn-mcp"
|
||||
}
|
||||
});
|
||||
servers.Add("mcp-python-interpreter", new StdioMcpServer()
|
||||
{
|
||||
Name = "mcp-python-interpreter",
|
||||
Type = "stdio",
|
||||
Command = "uvx",
|
||||
Args = new List<string>()
|
||||
{
|
||||
"--native-tls",
|
||||
"mcp-python-interpreter",
|
||||
"--dir",
|
||||
"F:\\secondsemester\\linktool\\test\\LinkTool0607\\LinkTool0607.gdb",
|
||||
"--python-path",
|
||||
"C:\\Program Files\\ArcGIS\\Pro\\bin\\Python\\envs\\custom\\python.exe"
|
||||
}
|
||||
});
|
||||
// servers.Add("fetch", new StdioMcpServer()
|
||||
// {
|
||||
// Name = "fetch",
|
||||
// Type = "stdio",
|
||||
// Command = "uvx",
|
||||
// Args = new List<string>()
|
||||
// {
|
||||
// "mcp-server-fetch"
|
||||
// }
|
||||
// });
|
||||
// servers.Add("bing-search", new StdioMcpServer()
|
||||
// {
|
||||
// Name = "bing-search",
|
||||
// Type = "stdio",
|
||||
// Command = "npx",
|
||||
// Args = new List<string>()
|
||||
// {
|
||||
// "bing-cn-mcp"
|
||||
// }
|
||||
// });
|
||||
// servers.Add("mcp-python-interpreter", new StdioMcpServer()
|
||||
// {
|
||||
// Name = "mcp-python-interpreter",
|
||||
// Type = "stdio",
|
||||
// Command = "uvx",
|
||||
// Args = new List<string>()
|
||||
// {
|
||||
// "--native-tls",
|
||||
// "mcp-python-interpreter",
|
||||
// "--dir",
|
||||
// "F:\\secondsemester\\linktool\\test\\LinkTool0607\\LinkTool0607.gdb",
|
||||
// "--python-path",
|
||||
// "C:\\Program Files\\ArcGIS\\Pro\\bin\\Python\\envs\\custom\\python.exe"
|
||||
// }
|
||||
// });
|
||||
}
|
||||
|
||||
public McpServerList(string json)
|
||||
|
||||
@ -48,7 +48,7 @@
|
||||
<ComboBoxItem Content="deepseek-r1-distill-llama-70b" />
|
||||
<ComboBoxItem Content="deepseek-v3" />
|
||||
<Separator></Separator>
|
||||
<ComboBoxItem Content="gpt-4o" />
|
||||
<ComboBoxItem Content="o4-mini" />
|
||||
<ComboBoxItem Content="claude-sonnet-4-20250514-thinking" />
|
||||
<ComboBoxItem Content="claude-sonnet-4-20250514" />
|
||||
<ComboBoxItem Content="grok-3-reasoner" />
|
||||
|
||||
@ -6,4 +6,6 @@ public class ChatMessageItem : MessageListItem
|
||||
public string role { get; set; }
|
||||
public string content { get; set; }
|
||||
public MessageType type { get; set; }
|
||||
|
||||
public long accumulateTokens { get; set; }
|
||||
}
|
||||
@ -16,4 +16,5 @@ public interface MessageListItem
|
||||
string role { get; set; }
|
||||
string content { get; set; }
|
||||
MessageType type { get; set; }
|
||||
long accumulateTokens { get; set; }
|
||||
}
|
||||
@ -12,4 +12,6 @@ public class ToolMessageItem : MessageListItem
|
||||
public MessageType type { get; set; }
|
||||
public string status { get; set; }
|
||||
public string result { get; set; }
|
||||
|
||||
public long accumulateTokens { get; set; }
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user