MCPcopy
hub / github.com/HKUDS/DeepCode / display_results

Method display_results

cli/cli_app.py:295–387  ·  view source on GitHub ↗

显示处理结果

(
        self,
        analysis_result: str,
        download_result: str,
        repo_result: str,
        pipeline_mode: str = "comprehensive",
    )

Source from the content-addressed store, hash-verified

293 return error_result
294
295 def display_results(
296 self,
297 analysis_result: str,
298 download_result: str,
299 repo_result: str,
300 pipeline_mode: str = "comprehensive",
301 ):
302 """显示处理结果"""
303 self.cli.print_results_header()
304
305 # 显示流水线模式
306 if pipeline_mode == "chat":
307 mode_display = "💬 Chat Planning Mode"
308 elif pipeline_mode == "comprehensive":
309 mode_display = "🧠 Comprehensive Mode"
310 else:
311 mode_display = "⚡ Optimized Mode"
312 print(
313 f"{Colors.BOLD}{Colors.PURPLE}🤖 PIPELINE MODE: {mode_display}{Colors.ENDC}"
314 )
315 self.cli.print_separator("─", 79, Colors.PURPLE)
316
317 print(f"{Colors.BOLD}{Colors.OKCYAN}📊 ANALYSIS PHASE RESULTS:{Colors.ENDC}")
318 self.cli.print_separator("─", 79, Colors.CYAN)
319
320 # 尝试解析并格式化分析结果
321 try:
322 if analysis_result.strip().startswith("{"):
323 parsed_analysis = json.loads(analysis_result)
324 print(json.dumps(parsed_analysis, indent=2, ensure_ascii=False))
325 else:
326 print(
327 analysis_result[:1000] + "..."
328 if len(analysis_result) > 1000
329 else analysis_result
330 )
331 except Exception:
332 print(
333 analysis_result[:1000] + "..."
334 if len(analysis_result) > 1000
335 else analysis_result
336 )
337
338 print(f"\n{Colors.BOLD}{Colors.PURPLE}📥 DOWNLOAD PHASE RESULTS:{Colors.ENDC}")
339 self.cli.print_separator("─", 79, Colors.PURPLE)
340 print(
341 download_result[:1000] + "..."
342 if len(download_result) > 1000
343 else download_result
344 )
345
346 print(
347 f"\n{Colors.BOLD}{Colors.GREEN}⚙️ IMPLEMENTATION PHASE RESULTS:{Colors.ENDC}"
348 )
349 self.cli.print_separator("─", 79, Colors.GREEN)
350 print(repo_result[:1000] + "..." if len(repo_result) > 1000 else repo_result)
351
352 # 尝试提取生成的代码目录信息

Callers 1

process_inputMethod · 0.95

Calls 2

print_results_headerMethod · 0.45
print_separatorMethod · 0.45

Tested by

no test coverage detected