Format the summary data into a table format for display.
(summary: Dict[str, Any])
| 162 | |
| 163 | |
| 164 | def format_summary_table(summary: Dict[str, Any]) -> List[List[str]]: |
| 165 | """Format the summary data into a table format for display.""" |
| 166 | table_data = [] |
| 167 | |
| 168 | # Add task rows |
| 169 | for task in summary["tasks"]: |
| 170 | table_data.append( |
| 171 | [ |
| 172 | task["task_id"], |
| 173 | task["result"], |
| 174 | task["failure_type"], |
| 175 | task["tests"], |
| 176 | task["passed"], |
| 177 | task["passed_percentage"], |
| 178 | task["time_seconds"], |
| 179 | task["cost"], |
| 180 | task["input_tokens"], |
| 181 | task["output_tokens"], |
| 182 | task["cache_tokens"], |
| 183 | task["turns"], |
| 184 | ] |
| 185 | ) |
| 186 | |
| 187 | # Add blank row as divider |
| 188 | table_data.append([""] * len(summary["headers"])) |
| 189 | |
| 190 | # Add total row |
| 191 | total_row = summary["total_row"] |
| 192 | table_data.append( |
| 193 | [ |
| 194 | total_row["task_id"], |
| 195 | total_row["result"], |
| 196 | total_row["failure_type"], |
| 197 | total_row["tests"], |
| 198 | total_row["passed"], |
| 199 | total_row["passed_percentage"], |
| 200 | total_row["time_seconds"], |
| 201 | total_row["cost"], |
| 202 | total_row["input_tokens"], |
| 203 | total_row["output_tokens"], |
| 204 | total_row["cache_tokens"], |
| 205 | total_row["turns"], |
| 206 | ] |
| 207 | ) |
| 208 | |
| 209 | return table_data |
| 210 | |
| 211 | |
| 212 | def generate_html_table(results: BenchmarkResults, experiment_dir: Optional[Path] = None) -> str: |
no outgoing calls
no test coverage detected