Skip to content

Commit

Permalink
fix openapi bugs in agentfabric
Browse files Browse the repository at this point in the history
  • Loading branch information
zzhangpurdue committed Nov 13, 2024
1 parent 0911e1b commit 27f8fac
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 14 deletions.
10 changes: 5 additions & 5 deletions apps/agentfabric/appBot.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,11 @@ def send_message(chatbot, input, _state, _user_token):
if 'user_agent' not in _state:
init_user(_state, _user_token)

kwargs = {
name.lower(): os.getenv(value.value)
for name, value in ApiNames.__members__.items()
}

# kwargs = {
# name.lower(): os.getenv(value.value)
# for name, value in ApiNames.__members__.items()
# }
kwargs = {}
# 将发送的消息添加到聊天历史
_uuid_str = check_uuid(uuid_str)
user_agent = _state['user_agent']
Expand Down
10 changes: 5 additions & 5 deletions apps/agentfabric/config_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,8 @@ def parse_configuration(uuid_str='', use_tool_api=False):

tools_info = builder_cfg.tools
available_tool_list = []
available_plugin_list = []

for key, value in tools_info.items():
if key in tool_cfg:
tool_cfg[key]['use'] = value['use']
Expand All @@ -166,13 +168,11 @@ def parse_configuration(uuid_str='', use_tool_api=False):
tool_cfg[key] = value
if value['use']:
available_tool_list.append(key)
if value['is_openapi']:
available_plugin_list.append(key)

plugin_cfg = {}
available_plugin_list = []
if use_tool_api and getattr(builder_cfg, 'openapi_list', None):
available_plugin_list = builder_cfg.openapi_list
else:
available_plugin_list = []
if len(available_plugin_list) == 0:
openapi_plugin_file = get_user_openapi_plugin_cfg_file(uuid_str)
openapi_plugin_cfg_file_temp = './config/openapi_plugin_config.json'
if os.path.exists(openapi_plugin_file):
Expand Down
5 changes: 1 addition & 4 deletions apps/agentfabric/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -404,10 +404,7 @@ def preview_chat(uuid_str, session_str):
file_paths.append(file_path)
logger.info(f'/preview/chat/{uuid_str}/{session_str}: files: {file_paths}')
# Generating the kwargs dictionary
kwargs = {
name.lower(): os.getenv(value.value)
for name, value in ApiNames.__members__.items()
}
kwargs = {}

def generate():
try:
Expand Down

0 comments on commit 27f8fac

Please sign in to comment.