feat: update data analysis agent logic and refine associated prompts.
This commit is contained in:
@@ -60,6 +60,7 @@ class DataAnalysisAgent:
|
||||
self.current_round = 0
|
||||
self.session_output_dir = None
|
||||
self.executor = None
|
||||
self.data_profile = "" # 存储数据画像
|
||||
|
||||
def _process_response(self, response: str) -> Dict[str, Any]:
|
||||
"""
|
||||
@@ -240,6 +241,9 @@ class DataAnalysisAgent:
|
||||
print("🔍 正在生成数据画像...")
|
||||
data_profile = load_and_profile_data(files)
|
||||
print("✅ 数据画像生成完毕")
|
||||
|
||||
# 保存到实例变量供最终报告使用
|
||||
self.data_profile = data_profile
|
||||
|
||||
# 构建初始prompt
|
||||
initial_prompt = f"""用户需求: {user_input}"""
|
||||
@@ -461,6 +465,7 @@ class DataAnalysisAgent:
|
||||
prompt = final_report_system_prompt.format(
|
||||
current_round=self.current_round,
|
||||
session_output_dir=self.session_output_dir,
|
||||
data_profile=self.data_profile, # 注入数据画像
|
||||
figures_summary=figures_summary,
|
||||
code_results_summary=code_results_summary,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user