feat(editor): ChatExcel

🔥ChatExcel Mode Complete
This commit is contained in:
yhjun1026 2023-08-25 16:28:42 +08:00
parent ca5ed11623
commit 0ba7f00ff5

View File

@ -37,21 +37,23 @@ class LearningExcelOutputParser(BaseOutputParser):
plans = response[key] plans = response[key]
return ExcelResponse(desciption=desciption, clounms=clounms, plans=plans) return ExcelResponse(desciption=desciption, clounms=clounms, plans=plans)
def parse_view_response(self, speak, data) -> str: def parse_view_response(self, speak, data) -> str:
### tool out data to table view ### tool out data to table view
html_title = f"### **数据简介:**{data.desciption} " html_title = f"### **数据简介**\n{data.desciption} "
html_colunms = f"<br> ### **数据结构:**" html_colunms = f"### **数据结构**\n"
column_index = 0 column_index = 0
for item in data.clounms: for item in data.clounms:
column_index +=1 column_index +=1
keys = item.keys() keys = item.keys()
for key in 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 index = 0
for item in data.plans: for item in data.plans:
index +=1 index +=1
html_plans = html_plans + f"{index}.{item} \n" html_plans = html_plans + f"{item} \n"
html = f"""{html_title}{html_colunms}{html_plans}""" html = f"""{html_title}\n{html_colunms}\n{html_plans}"""
return html return html