mirror of
https://github.com/open-webui/open-webui.git
synced 2026-09-12 23:02:35 +00:00
refac
This commit is contained in:
parent
0313ea0238
commit
ffae4116a8
1 changed files with 8 additions and 2 deletions
|
|
@ -89,8 +89,14 @@ class MCPClient:
|
|||
if not self.session:
|
||||
raise RuntimeError('MCP client is not connected.')
|
||||
|
||||
result = await self.session.list_tools()
|
||||
tools = result.tools
|
||||
tools = []
|
||||
cursor = None
|
||||
while True:
|
||||
result = await self.session.list_tools(cursor=cursor)
|
||||
tools.extend(result.tools)
|
||||
cursor = result.nextCursor
|
||||
if cursor is None:
|
||||
break
|
||||
|
||||
tool_specs = []
|
||||
for tool in tools:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue