Skip to content

Commit

Permalink
Support import openapi in webui
Browse files Browse the repository at this point in the history
  • Loading branch information
mzr1996 committed Mar 13, 2024
1 parent 8e5e96a commit c90f5da
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions webui/modules/ui_tools.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import inspect
import os.path as osp
from functools import partial

import gradio as gr
Expand Down Expand Up @@ -96,9 +97,11 @@ def setup_tools(*args):


def import_remote_tools(server: str):
if not server.startswith('http'):
server = 'http://' + server
tools = RemoteTool.from_server(server)
if osp.isfile(server):
tools = RemoteTool.from_openapi(server)
else:
server = server if server.startswith('http') else f'http://{server}'
tools = RemoteTool.from_openapi(server)
msg = ''
for tool in tools:
if tool.name in shared.tool_settings:
Expand Down

0 comments on commit c90f5da

Please sign in to comment.