Skip to content

Commit ed4df23

Browse files
authored
fix: typo error fix (#1228)
1 parent 0e61c55 commit ed4df23

25 files changed

+39
-37
lines changed

dbgpt/_private/config.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,8 @@ def __init__(self) -> None:
133133
### Related configuration of built-in commands
134134
self.command_registry = []
135135

136-
### Relate configuration of disply commands
137-
self.command_disply = []
136+
### Relate configuration of display commands
137+
self.command_dispaly = []
138138

139139
disabled_command_categories = os.getenv("DISABLED_COMMAND_CATEGORIES")
140140
if disabled_command_categories:

dbgpt/agent/actions/chart_action.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ async def a_run(
6565
"There is no implementation class bound to database resource execution!"
6666
)
6767
data_df = await resource_db_client.a_query_to_df(resource.value, param.sql)
68-
view = await self.render_protocal.disply(
68+
view = await self.render_protocal.display(
6969
chart=json.loads(param.json()), data_df=data_df
7070
)
7171
return ActionOutput(

dbgpt/agent/actions/code_action.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ async def a_run(
6565
param["language"] = code_blocks[0][0]
6666
param["code"] = code_blocks
6767
param["log"] = logs
68-
view = await self.render_protocal.disply(content=param)
68+
view = await self.render_protocal.display(content=param)
6969
return ActionOutput(is_exe_success=exit_success, content=content, view=view)
7070
except Exception as e:
7171
logger.exception("Code Action Run Failed!")

dbgpt/agent/actions/dashboard_action.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ async def a_run(
8282
logger.warn(f"Sql excute Failed!{str(e)}")
8383
chart_dict["err_msg"] = str(e)
8484
chart_params.append(chart_dict)
85-
view = await self.render_protocal.disply(charts=chart_params)
85+
view = await self.render_protocal.display(charts=chart_params)
8686
return ActionOutput(
8787
is_exe_success=True,
8888
content=json.dumps([chart_item.dict() for chart_item in chart_items]),

dbgpt/agent/actions/indicator_action.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ async def a_run(
118118
"err_msg": err_msg,
119119
}
120120

121-
view = await self.render_protocal.disply(content=plugin_param)
121+
view = await self.render_protocal.display(content=plugin_param)
122122

123123
return ActionOutput(
124124
is_exe_success=response_success, content=response.text, view=view

dbgpt/agent/actions/plugin_action.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ async def a_run(
106106
"err_msg": err_msg,
107107
}
108108

109-
view = await self.render_protocal.disply(content=plugin_param)
109+
view = await self.render_protocal.display(content=plugin_param)
110110

111111
return ActionOutput(
112112
is_exe_success=response_success, content=tool_result, view=view

dbgpt/agent/agents/expand/dashboard_assistant_agent.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from typing import Callable, Dict, List, Literal, Optional, Union
33

44
from dbgpt.agent.actions.dashboard_action import DashboardAction
5-
from dbgpt.agent.plugin.commands.command_mange import ApiCall
5+
from dbgpt.agent.plugin.commands.command_manage import ApiCall
66
from dbgpt.util.json_utils import find_json_objects
77

88
from ...memory.gpts_memory import GptsMemory

dbgpt/agent/agents/expand/retrieve_summary_assistant_agent.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from dbgpt.agent.agents.agent import Agent, AgentContext
1616
from dbgpt.agent.agents.base_agent import ConversableAgent
1717
from dbgpt.agent.memory.gpts_memory import GptsMemory
18-
from dbgpt.agent.plugin.commands.command_mange import ApiCall
18+
from dbgpt.agent.plugin.commands.command_manage import ApiCall
1919
from dbgpt.configs.model_config import PILOT_PATH
2020
from dbgpt.core.interface.message import ModelMessageRoleType
2121

dbgpt/agent/memory/gpts_memory.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,11 @@ async def _messages_to_agents_vis(self, messages: List[GptsMessage]):
102102
"markdown": view_info,
103103
}
104104
)
105-
return await vis_client.get(VisAgentMessages.vis_tag()).disply(
105+
return await vis_client.get(VisAgentMessages.vis_tag()).display(
106106
content=messages_view
107107
)
108108

109109
async def _messages_to_plan_vis(self, messages: List[Dict]):
110110
if messages is None or len(messages) <= 0:
111111
return ""
112-
return await vis_client.get(VisAgentPlans.vis_tag()).disply(content=messages)
112+
return await vis_client.get(VisAgentPlans.vis_tag()).display(content=messages)

dbgpt/agent/plugin/commands/built_in/audio_text.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
from dbgpt._private.config import Config
77

8-
from ..command_mange import command
8+
from ..command_manage import command
99

1010
CFG = Config()
1111

dbgpt/agent/plugin/commands/built_in/disply_type/show_chart_gen.py dbgpt/agent/plugin/commands/built_in/display_type/show_chart_gen.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from dbgpt.configs.model_config import PILOT_PATH
1414
from dbgpt.util.string_utils import is_scientific_notation
1515

16-
from ...command_mange import command
16+
from ...command_manage import command
1717

1818
matplotlib.use("Agg")
1919

dbgpt/agent/plugin/commands/built_in/disply_type/show_table_gen.py dbgpt/agent/plugin/commands/built_in/display_type/show_table_gen.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from pandas import DataFrame
44

5-
from ...command_mange import command
5+
from ...command_manage import command
66

77
logger = logging.getLogger(__name__)
88

dbgpt/agent/plugin/commands/built_in/disply_type/show_text_gen.py dbgpt/agent/plugin/commands/built_in/display_type/show_text_gen.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from pandas import DataFrame
44

5-
from ...command_mange import command
5+
from ...command_manage import command
66

77
logger = logging.getLogger(__name__)
88

dbgpt/agent/plugin/commands/built_in/image_gen.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
from dbgpt._private.config import Config
1111

12-
from ..command_mange import command
12+
from ..command_manage import command
1313

1414
logger = logging.getLogger(__name__)
1515
CFG = Config()

dbgpt/agent/resource/resource_plugin_api.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import os
33
from typing import Optional
44

5-
from dbgpt.agent.plugin.commands.command_mange import execute_command
5+
from dbgpt.agent.plugin.commands.command_manage import execute_command
66
from dbgpt.agent.plugin.generator import PluginPromptGenerator
77
from dbgpt.agent.plugin.plugins_util import scan_plugin_file, scan_plugins
88
from dbgpt.agent.resource.resource_api import AgentResource

dbgpt/app/base.py

+9-9
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def async_db_summary(system_app: SystemApp):
3131

3232

3333
def server_init(param: "WebServerParameters", system_app: SystemApp):
34-
from dbgpt.agent.plugin.commands.command_mange import CommandRegistry
34+
from dbgpt.agent.plugin.commands.command_manage import CommandRegistry
3535

3636
# logger.info(f"args: {args}")
3737
# init config
@@ -58,15 +58,15 @@ def server_init(param: "WebServerParameters", system_app: SystemApp):
5858

5959
cfg.command_registry = command_registry
6060

61-
command_disply_commands = [
62-
"dbgpt.agent.plugin.commands.built_in.disply_type.show_chart_gen",
63-
"dbgpt.agent.plugin.commands.built_in.disply_type.show_table_gen",
64-
"dbgpt.agent.plugin.commands.built_in.disply_type.show_text_gen",
61+
command_dispaly_commands = [
62+
"dbgpt.agent.plugin.commands.built_in.display_type.show_chart_gen",
63+
"dbgpt.agent.plugin.commands.built_in.display_type.show_table_gen",
64+
"dbgpt.agent.plugin.commands.built_in.display_type.show_text_gen",
6565
]
66-
command_disply_registry = CommandRegistry()
67-
for command in command_disply_commands:
68-
command_disply_registry.import_commands(command)
69-
cfg.command_disply = command_disply_registry
66+
command_dispaly_registry = CommandRegistry()
67+
for command in command_dispaly_commands:
68+
command_dispaly_registry.import_commands(command)
69+
cfg.command_display = command_dispaly_commands
7070

7171

7272
def _create_model_start_listener(system_app: SystemApp):

dbgpt/app/dbgpt_server.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,9 @@ def mount_routers(app: FastAPI):
101101

102102

103103
def mount_static_files(app: FastAPI):
104-
from dbgpt.agent.plugin.commands.built_in.disply_type import static_message_img_path
104+
from dbgpt.agent.plugin.commands.built_in.display_type import (
105+
static_message_img_path,
106+
)
105107

106108
os.makedirs(static_message_img_path, exist_ok=True)
107109
app.mount(

dbgpt/app/scene/chat_agent/chat.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from typing import Dict, List
33

44
from dbgpt._private.config import Config
5-
from dbgpt.agent.plugin.commands.command_mange import ApiCall
5+
from dbgpt.agent.plugin.commands.command_manage import ApiCall
66
from dbgpt.agent.plugin.generator import PluginPromptGenerator
77
from dbgpt.app.scene import BaseChat, ChatScene
88
from dbgpt.component import ComponentType

dbgpt/app/scene/chat_data/chat_excel/excel_analyze/chat.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from typing import Dict
44

55
from dbgpt._private.config import Config
6-
from dbgpt.agent.plugin.commands.command_mange import ApiCall
6+
from dbgpt.agent.plugin.commands.command_manage import ApiCall
77
from dbgpt.app.scene import BaseChat, ChatScene
88
from dbgpt.app.scene.chat_data.chat_excel.excel_learning.chat import ExcelLearning
99
from dbgpt.app.scene.chat_data.chat_excel.excel_reader import ExcelReader
@@ -45,15 +45,15 @@ def __init__(self, chat_param: Dict):
4545
KNOWLEDGE_UPLOAD_ROOT_PATH, chat_mode.value(), self.select_param
4646
)
4747
)
48-
self.api_call = ApiCall(display_registry=CFG.command_disply)
48+
self.api_call = ApiCall(display_registry=CFG.command_display)
4949
super().__init__(chat_param=chat_param)
5050

5151
@trace()
5252
async def generate_input_values(self) -> Dict:
5353
input_values = {
5454
"user_input": self.current_user_input,
5555
"table_name": self.excel_reader.table_name,
56-
"disply_type": self._generate_numbered_list(),
56+
"display_type": self._generate_numbered_list(),
5757
}
5858
return input_values
5959

dbgpt/app/scene/chat_data/chat_excel/excel_analyze/prompt.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
2020
Constraint:
2121
1.Please fully understand the user's problem and use duckdb sql for analysis. The analysis content is returned in the output format required below. Please output the sql in the corresponding sql parameter.
22-
2.Please choose the best one from the display methods given below for data rendering, and put the type name into the name parameter value that returns the required format. If you cannot find the most suitable one, use 'Table' as the display method. , the available data display methods are as follows: {disply_type}
22+
2.Please choose the best one from the display methods given below for data rendering, and put the type name into the name parameter value that returns the required format. If you cannot find the most suitable one, use 'Table' as the display method. , the available data display methods are as follows: {display_type}
2323
3.The table name that needs to be used in SQL is: {table_name}. Please check the sql you generated and do not use column names that are not in the data structure.
2424
4.Give priority to answering using data analysis. If the user's question does not involve data analysis, you can answer according to your understanding.
2525
5.The sql part of the output content is converted to: <api-call><name>[data display mode]</name><args><sql>[correct duckdb data analysis sql]</sql></args></api - call> For this format, please refer to the return format requirements.
@@ -36,7 +36,7 @@
3636
请使用历史对话中的数据结构信息,在满足下面约束条件下通过duckdb sql数据分析回答用户的问题。
3737
约束条件:
3838
1.请充分理解用户的问题,使用duckdb sql的方式进行分析, 分析内容按下面要求的输出格式返回,sql请输出在对应的sql参数中
39-
2.请从如下给出的展示方式种选择最优的一种用以进行数据渲染,将类型名称放入返回要求格式的name参数值种,如果找不到最合适的则使用'Table'作为展示方式,可用数据展示方式如下: {disply_type}
39+
2.请从如下给出的展示方式种选择最优的一种用以进行数据渲染,将类型名称放入返回要求格式的name参数值种,如果找不到最合适的则使用'Table'作为展示方式,可用数据展示方式如下: {display_type}
4040
3.SQL中需要使用的表名是: {table_name},请检查你生成的sql,不要使用没在数据结构中的列名
4141
4.优先使用数据分析的方式回答,如果用户问题不涉及数据分析内容,你可以按你的理解进行回答
4242
5.输出内容中sql部分转换为:<api-call><name>[数据显示方式]</name><args><sql>[正确的duckdb数据分析sql]</sql></args></api- call> 这样的格式,参考返回格式要求

dbgpt/app/scene/chat_db/auto_execute/chat.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from typing import Dict
22

33
from dbgpt._private.config import Config
4-
from dbgpt.agent.plugin.commands.command_mange import ApiCall
4+
from dbgpt.agent.plugin.commands.command_manage import ApiCall
55
from dbgpt.app.scene import BaseChat, ChatScene
66
from dbgpt.util.executor_utils import blocking_func_to_async
77
from dbgpt.util.tracer import root_tracer, trace
@@ -40,7 +40,7 @@ def __init__(self, chat_param: Dict):
4040
self.database = CFG.LOCAL_DB_MANAGE.get_connect(self.db_name)
4141

4242
self.top_k: int = 50
43-
self.api_call = ApiCall(display_registry=CFG.command_disply)
43+
self.api_call = ApiCall(display_registry=CFG.command_display)
4444

4545
@trace()
4646
async def generate_input_values(self) -> Dict:

dbgpt/serve/agent/team/plan/plan_action.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ async def a_run(
105105
f"- {item.serial_number}.{item.content}[{item.agent}]"
106106
)
107107

108-
# view = await self.render_protocal.disply(content=plan_content)
108+
# view = await self.render_protocal.display(content=plan_content)
109109
view = "\n".join(mk_plans)
110110
return ActionOutput(
111111
is_exe_success=True,

dbgpt/vis/base.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ async def generate_param(self, **kwargs) -> Optional[str]:
2020
"""
2121
return kwargs["content"]
2222

23-
async def disply(self, **kwargs) -> Optional[str]:
23+
async def display(self, **kwargs) -> Optional[str]:
2424
return f"```{self.vis_tag()}\n{json.dumps(await self.generate_param(**kwargs), default=serialize, ensure_ascii=False)}\n```"
2525

2626
@classmethod

0 commit comments

Comments
 (0)