Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] [chat data] table schema haven't comment #2260

Open
4 of 15 tasks
305607610 opened this issue Dec 30, 2024 · 6 comments
Open
4 of 15 tasks

[Bug] [chat data] table schema haven't comment #2260

305607610 opened this issue Dec 30, 2024 · 6 comments
Labels
bug Something isn't working Waiting for reply

Comments

@305607610
Copy link

305607610 commented Dec 30, 2024

Search before asking

  • I had searched in the issues and found no similar issues.

Operating system information

Windows

Python version information

3.10

DB-GPT version

main

Related scenes

  • Chat Data
  • Chat Excel
  • Chat DB
  • Chat Knowledge
  • Model Management
  • Dashboard
  • Plugins

Installation Information

Device information

  • 4090
  • GPU Count: 1
  • GPU Memory: 24G

Models information

m3e

What happened

表结构定义没有表注释信息导致查询不到内容
image

What you expected to happen

messages:
[{'role': 'system', 'content': '\n请根据用户选择的数据库和该库的部分可用表结构定义来回答用户问题.\n数据库名:\n gzt_boot\n表结构定义:\n [('ops_task_order(trouble_level_id,ops_team_manager_opinion,safe_production_opinion,safe_production_user_name,safe_production_user_account,safe_producti ... (742 characters truncated) ... om_point_name,custom_point_id,ops_team_name,custom_dept_id,custom_company_name,custom_company_id,start_user_name,start_user_account,start_user_id,fi)',)]\n\n约束:\n 1. 请根据用户问题理解用户意图,使用给出表结构定义创建一个语法正确的 mysql sql,如果不需要sql,则直接回答用户问题。\n 2. 除非用户在问题中指定了他希望获得的具体数据行数,否则始终将查询限制为最多 50 个结果。\n 3. 只能使用表结构信息中提供的表来生成 sql,如果无法根据提供的表结构中生成 sql ,请说:“提供的表结构信息不足以生成 sql 查询。” 禁止随意捏造信息。\n 4. 请注意生成SQL时不要弄错表和列的关系。\n 12. 请从如下给出的展示方式种选择最优的一种用以进行数据渲染,将类型名称放入返回要求格式的name参数值种,如果找不到最合适的则使用'Table'作为展示方式,可用数据展示方式如下: response_line_chart:used to display comparative trend analysis data. 当需要展示折线图时使用.\nresponse_bar_chart:used to display comparative trend analysis data. 当需要展示条形图时使用.\nresponse_column_chart:used to display comparative trend analysis data. 当需要展示柱状图时使用.\nresponse_pie_chart:suitable for scenarios such as proportion and distribution statistics\nresponse_table:suitable for display with many display columns or non-numeric columns\nresponse_scatter_plot:Suitable for exploring relationships between variables, detecting outliers, etc.\nresponse_bubble_chart:Suitable for relationships between multiple variables, highlighting outliers or special situations, etc.\nresponse_donut_chart:Suitable for hierarchical structure representation, category proportion display and highlighting key categories, etc.\nresponse_area_chart:Suitable for visualization of time series data, comparison of multiple groups of data, analysis of data change trends, etc.\nresponse_heatmap:Suitable for visual analysis of time series data, large-scale data sets, distribution of classified data, etc.\n用户问题:\n 故障类别占比情况\n请一步步思考并按照以下JSON格式回复:\n "{\n \"thoughts\": \"thoughts summary to say to user\",\n \"sql\": \"SQL Query to run\",\n \"display_type\": \"Data display method\"\n}"\n确保返回正确的json并且可以被Python json.loads方法解析.\n必须使用用户提问的语言进行回复\n\n'}, {'role': 'user', 'content': '故障类别占比情况'}]
llm_adapter:

model prompt:

system:
请根据用户选择的数据库和该库的部分可用表结构定义来回答用户问题.
数据库名:
gzt_boot
表结构定义:
[('ops_task_order(trouble_level_id,ops_team_manager_opinion,safe_production_opinion,safe_production_user_name,safe_production_user_account,safe_producti ... (742 characters truncated) ... om_point_name,custom_point_id,ops_team_name,custom_dept_id,custom_company_name,custom_company_id,start_user_name,start_user_account,start_user_id,fi)',)]

约束:
1. 请根据用户问题理解用户意图,使用给出表结构定义创建一个语法正确的 mysql sql,如果不需要sql,则直接回答用户问题。
2. 除非用户在问题中指定了他希望获得的具体数据行数,否则始终将查询限制为最多 50 个结果。
3. 只能使用表结构信息中提供的表来生成 sql,如果无法根据提供的表结构中生成 sql ,请说:“提供的表结构信息不足以生成 sql 查询。” 禁止随意捏造信息。
4. 请注意生成SQL时不要弄错表和列的关系。

How to reproduce

none

Additional context

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!
@305607610 305607610 added bug Something isn't working Waiting for reply labels Dec 30, 2024
@Aries-ckt
Copy link
Collaborator

hi, are there any comment in your mysql table schema?

@Aries-ckt Aries-ckt changed the title [Bug] [chat data] 表结构定义没有表注释信息 [Bug] [chat data] table schema haven't comment Dec 30, 2024
@305607610
Copy link
Author

image

@Aries-ckt
Copy link
Collaborator

what's your dbgpt version and how many columns in this table?

@305607610
Copy link
Author

version: v0.6.3
84 columns

@Aries-ckt
Copy link
Collaborator

Aries-ckt commented Jan 1, 2025

hi, try delete the datasource in dbgpt web, and add the ops_task_order again.
and when delete the datasource, make sure DB-GPT/pilot/data/{datasource_name}.vectordb is deleted.

@305607610
Copy link
Author

没有用 删除后重新添加还是没有表注释信息

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Waiting for reply
Projects
None yet
Development

No branches or pull requests

2 participants