mirror of
https://github.com/open-webui/open-webui
synced 2025-05-18 20:31:36 +00:00
Merge pull request #12602 from alpha-pet/fix-tool-server-indexing-mismatch
fix: mismatch between TOOL_SERVERS / TOOL_SERVER_CONNECTIONS indexing
This commit is contained in:
commit
a3e477e100
@ -45,7 +45,7 @@ async def get_tools(request: Request, user=Depends(get_verified_user)):
|
|||||||
)
|
)
|
||||||
|
|
||||||
tools = Tools.get_tools()
|
tools = Tools.get_tools()
|
||||||
for idx, server in enumerate(request.app.state.TOOL_SERVERS):
|
for server in request.app.state.TOOL_SERVERS:
|
||||||
tools.append(
|
tools.append(
|
||||||
ToolUserResponse(
|
ToolUserResponse(
|
||||||
**{
|
**{
|
||||||
@ -60,7 +60,7 @@ async def get_tools(request: Request, user=Depends(get_verified_user)):
|
|||||||
.get("description", ""),
|
.get("description", ""),
|
||||||
},
|
},
|
||||||
"access_control": request.app.state.config.TOOL_SERVER_CONNECTIONS[
|
"access_control": request.app.state.config.TOOL_SERVER_CONNECTIONS[
|
||||||
idx
|
server["idx"]
|
||||||
]
|
]
|
||||||
.get("config", {})
|
.get("config", {})
|
||||||
.get("access_control", None),
|
.get("access_control", None),
|
||||||
|
@ -56,7 +56,12 @@ def get_tools(
|
|||||||
tool_server_connection = (
|
tool_server_connection = (
|
||||||
request.app.state.config.TOOL_SERVER_CONNECTIONS[server_idx]
|
request.app.state.config.TOOL_SERVER_CONNECTIONS[server_idx]
|
||||||
)
|
)
|
||||||
tool_server_data = request.app.state.TOOL_SERVERS[server_idx]
|
tool_server_data = None
|
||||||
|
for server in request.app.state.TOOL_SERVERS:
|
||||||
|
if server["idx"] == server_idx:
|
||||||
|
tool_server_data = server
|
||||||
|
break
|
||||||
|
assert tool_server_data is not None
|
||||||
specs = tool_server_data.get("specs", [])
|
specs = tool_server_data.get("specs", [])
|
||||||
|
|
||||||
for spec in specs:
|
for spec in specs:
|
||||||
|
Loading…
Reference in New Issue
Block a user