refactor(agent): Refactor resource of agents (#1518)

This commit is contained in:
Fangyin Cheng
2024-05-15 09:57:19 +08:00
committed by GitHub
parent db4d318a5f
commit 559affe87d
102 changed files with 2633 additions and 2549 deletions

View File

@@ -31,7 +31,6 @@ def async_db_summary(system_app: SystemApp):
def server_init(param: "WebServerParameters", system_app: SystemApp):
from dbgpt.agent.plugin.commands.command_manage import CommandRegistry
# logger.info(f"args: {args}")
# init config
@@ -43,28 +42,6 @@ def server_init(param: "WebServerParameters", system_app: SystemApp):
# load_native_plugins(cfg)
signal.signal(signal.SIGINT, signal_handler)
# Loader plugins and commands
command_categories = []
# exclude commands
command_categories = [
x for x in command_categories if x not in cfg.disabled_command_categories
]
command_registry = CommandRegistry()
for command_category in command_categories:
command_registry.import_commands(command_category)
cfg.command_registry = command_registry
command_dispaly_commands = [
"dbgpt.agent.plugin.commands.built_in.display_type.show_chart_gen",
"dbgpt.agent.plugin.commands.built_in.display_type.show_table_gen",
"dbgpt.agent.plugin.commands.built_in.display_type.show_text_gen",
]
command_dispaly_registry = CommandRegistry()
for command in command_dispaly_commands:
command_dispaly_registry.import_commands(command)
cfg.command_display = command_dispaly_commands
def _create_model_start_listener(system_app: SystemApp):
def startup_event(wh):