feat: 完善 MCP 管理和实现 WebUI MCP 相关的页面

This commit is contained in:
Soulter
2025-03-23 16:31:26 +08:00
parent 9f8e960ebe
commit 046f5e645e
15 changed files with 1820 additions and 650 deletions
@@ -80,7 +80,7 @@ class ProviderOpenAIOfficial(Provider):
async def _query(self, payloads: dict, tools: FuncCall) -> LLMResponse:
if tools:
tool_list = await tools.get_func_desc_openai_style()
tool_list = tools.get_func_desc_openai_style()
if tool_list:
payloads["tools"] = tool_list
@@ -124,11 +124,6 @@ class ProviderOpenAIOfficial(Provider):
for tool in tools.func_list:
if tool.name == tool_call.function.name:
args = json.loads(tool_call.function.arguments)
if (
tool_call.function.name.startswith("mcp:")
and tool_call.function.name.split(":")[1] in tools.mcp_client_dict
):
args = json.loads(tool_call.function.arguments)
args_ls.append(args)
func_name_ls.append(tool_call.function.name)
llm_response.role = "tool"