Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/tool/chart_visualization/chart_prepare.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ class VisualizationPrepare(NormalPythonExecute):
## Visualization Type
1. Data loading logic
2. Csv Data and chart description generate
2.1 Csv data (The data you want to visulazation, cleaning / transform from origin data, saved in .csv)
2.1 Csv data (The data you want to visualization, cleaning / transform from origin data, saved in .csv)
2.2 Chart description of csv data (The chart title or description should be concise and clear. Examples: 'Product sales distribution', 'Monthly revenue trend'.)
3. Save information in json file.( format: {"csvFilePath": string, "chartTitle": string}[])
## Insight Type
1. Select the insights from the data_visualization results that you want to add to the chart.
2. Save information in json file.( format: {"chartPath": string, "insights_id": number[]}[])
# Note
1. You can generate one or multiple csv data with different visualization needs.
2. Make each chart data esay, clean and different.
2. Make each chart data easy, clean and different.
3. Json file saving in utf-8 with path print: print(json_path)
""",
},
Expand Down
8 changes: 4 additions & 4 deletions app/tool/chart_visualization/data_visualization.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class DataVisualization(BaseTool):
"enum": ["zh", "en"],
},
},
"required": ["code"],
"required": ["json_path"],
}
llm: LLM = Field(default_factory=LLM, description="Language model instance")

Expand Down Expand Up @@ -89,7 +89,7 @@ def success_output_template(self, result: list[dict[str, str]]) -> str:
content += "\n" + item["insight_md"]
else:
content += "\n"
return f"Chart Generated Successful!\n{content}"
return f"Chart Generated Successfully!\n{content}"

async def data_visualization(
self, json_info: list[dict[str, str]], output_type: str, language: str
Expand Down Expand Up @@ -145,7 +145,7 @@ async def data_visualization(
else:
return {"observation": f"{self.success_output_template(success_list)}"}

async def add_insighs(
async def add_insights(
self, json_info: list[dict[str, str]], output_type: str
) -> str:
data_list = []
Expand Down Expand Up @@ -207,7 +207,7 @@ async def execute(
if tool_type == "visualization":
return await self.data_visualization(json_info, output_type, language)
else:
return await self.add_insighs(json_info, output_type)
return await self.add_insights(json_info, output_type)
except Exception as e:
return {
"observation": f"Error: {e}",
Expand Down
4 changes: 2 additions & 2 deletions app/tool/chart_visualization/python_execute.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ class NormalPythonExecute(PythonExecute):
# Note
1. The code should generate a comprehensive text-based report containing dataset overview, column details, basic statistics, derived metrics, timeseries comparisons, outliers, and key insights.
2. Use print() for all outputs so the analysis (including sections like 'Dataset Overview' or 'Preprocessing Results') is clearly visible and save it also
3. Save any report / processed files / each analysis result in worksapce directory: {directory}
3. Save any report / processed files / each analysis result in workspace directory: {directory}
4. Data reports need to be content-rich, including your overall analysis process and corresponding data visualization.
5. You can invode this tool step-by-step to do data analysis from summary to in-depth with data report saved also""".format(
5. You can invoke this tool step-by-step to do data analysis from summary to in-depth with data report saved also""".format(
directory=config.workspace_root
),
},
Expand Down