mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-09-05 11:01:09 +00:00
refactor(agent): Refactor resource of agents (#1518)
This commit is contained in:
@@ -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):
|
||||
|
Reference in New Issue
Block a user