mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-08-11 21:22:28 +00:00
feat(editor): ChatExcel
🔥ChatExcel Mode Complete
This commit is contained in:
parent
ca5ed11623
commit
0ba7f00ff5
@ -37,21 +37,23 @@ class LearningExcelOutputParser(BaseOutputParser):
|
||||
plans = response[key]
|
||||
return ExcelResponse(desciption=desciption, clounms=clounms, plans=plans)
|
||||
|
||||
|
||||
|
||||
def parse_view_response(self, speak, data) -> str:
|
||||
### tool out data to table view
|
||||
html_title = f"### **数据简介:**{data.desciption} "
|
||||
html_colunms = f"<br> ### **数据结构:**"
|
||||
html_title = f"### **数据简介**\n{data.desciption} "
|
||||
html_colunms = f"### **数据结构**\n"
|
||||
column_index = 0
|
||||
for item in data.clounms:
|
||||
column_index +=1
|
||||
keys = item.keys()
|
||||
for key in keys:
|
||||
html_colunms = html_colunms + f"- **{column_index}.{key}** _{item[key]}_ \n"
|
||||
html_colunms = html_colunms + f"- **[{key}]** _{item[key]}_\n"
|
||||
|
||||
html_plans = f"<br> ### **分析计划:** "
|
||||
html_plans = f"### **分析计划**\n"
|
||||
index = 0
|
||||
for item in data.plans:
|
||||
index +=1
|
||||
html_plans = html_plans + f"{index}.{item} \n"
|
||||
html = f"""{html_title}{html_colunms}{html_plans}"""
|
||||
html_plans = html_plans + f"{item} \n"
|
||||
html = f"""{html_title}\n{html_colunms}\n{html_plans}"""
|
||||
return html
|
||||
|
Loading…
Reference in New Issue
Block a user