mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-05-04 09:17:48 +08:00
Fix: add back MCP tool custom header (#13188)
### What problem does this PR solve? Add back custom header when use MCP. ### Type of change - [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
@ -76,6 +76,7 @@ class AgentParam(LLMParam, ToolParamBase):
|
||||
self.mcp = []
|
||||
self.max_rounds = 5
|
||||
self.description = ""
|
||||
self.custom_header = {}
|
||||
|
||||
|
||||
class Agent(LLM, ToolBase):
|
||||
@ -105,7 +106,8 @@ class Agent(LLM, ToolBase):
|
||||
|
||||
for mcp in self._param.mcp:
|
||||
_, mcp_server = MCPServerService.get_by_id(mcp["mcp_id"])
|
||||
tool_call_session = MCPToolCallSession(mcp_server, mcp_server.variables)
|
||||
custom_header = self._param.custom_header
|
||||
tool_call_session = MCPToolCallSession(mcp_server, mcp_server.variables, custom_header)
|
||||
for tnm, meta in mcp["tools"].items():
|
||||
self.tool_meta.append(mcp_tool_metadata_to_openai_tool(meta))
|
||||
self.tools[tnm] = tool_call_session
|
||||
|
||||
Reference in New Issue
Block a user