询问用户下一步操作
(final_state)
| 662 | |
| 663 | |
| 664 | def ask_user_for_next_action(final_state): |
| 665 | """询问用户下一步操作""" |
| 666 | console.print(get_text("\n[green]✅ 分析完成![/green]", "\n[green]✅ Analysis completed![/green]")) |
| 667 | console.print(get_text("[dim]输入 'rr' 查看研究报告 | 'dr' 查看数据报告 | 'n' 运行新分析 | 'q' 退出[/dim]", "[dim]Enter 'rr' to view research report | 'dr' to view data report | 'n' for new analysis | 'q' to quit[/dim]")) |
| 668 | |
| 669 | while True: |
| 670 | try: |
| 671 | user_input = input(get_text("请选择操作 (rr/dr/n/q): ", "Choose action (rr/dr/n/q): ")).strip().lower() |
| 672 | if user_input == 'rr': |
| 673 | display_detailed_report(final_state) |
| 674 | console.print(get_text("[dim]输入 'rr' 查看研究报告 | 'dr' 查看数据报告 | 'n' 运行新分析 | 'q' 退出[/dim]", "[dim]Enter 'rr' to view research report | 'dr' to view data report | 'n' for new analysis | 'q' to quit[/dim]")) |
| 675 | elif user_input == 'dr': |
| 676 | display_data_report(final_state) |
| 677 | console.print(get_text("[dim]输入 'rr' 查看研究报告 | 'dr' 查看数据报告 | 'n' 运行新分析 | 'q' 退出[/dim]", "[dim]Enter 'rr' to view research report | 'dr' to view data report | 'n' for new analysis | 'q' to quit[/dim]")) |
| 678 | elif user_input == 'n': |
| 679 | return final_state, "new_analysis" |
| 680 | elif user_input == 'q': |
| 681 | return final_state, "quit" |
| 682 | else: |
| 683 | console.print(get_text("[yellow]无效输入,请输入 'rr', 'dr', 'n' 或 'q'[/yellow]", "[yellow]Invalid input, please enter 'rr', 'dr', 'n' or 'q'[/yellow]")) |
| 684 | except KeyboardInterrupt: |
| 685 | console.print(get_text("\n[yellow]用户中断,退出...[/yellow]", "\n[yellow]User interrupted, exiting...[/yellow]")) |
| 686 | return final_state, "quit" |
| 687 | |
| 688 | def display_data_report(final_state: Dict): |
| 689 | """显示数据分析报告""" |
no test coverage detected