Enhanced chat input interface for coding requirements
(self)
| 432 | return url |
| 433 | |
| 434 | def get_chat_input(self) -> str: |
| 435 | """Enhanced chat input interface for coding requirements""" |
| 436 | self.print_separator("─", 79, Colors.PURPLE) |
| 437 | print(f"{Colors.BOLD}{Colors.PURPLE}💬 Chat Input Interface{Colors.ENDC}") |
| 438 | print( |
| 439 | f"{Colors.CYAN}Describe your coding requirements in natural language.{Colors.ENDC}" |
| 440 | ) |
| 441 | print( |
| 442 | f"{Colors.CYAN}Our AI will analyze your needs and generate a comprehensive implementation plan.{Colors.ENDC}" |
| 443 | ) |
| 444 | self.print_separator("─", 79, Colors.PURPLE) |
| 445 | |
| 446 | # Display examples to help users |
| 447 | print(f"\n{Colors.BOLD}{Colors.YELLOW}💡 Examples:{Colors.ENDC}") |
| 448 | print(f"{Colors.CYAN}Academic Research:{Colors.ENDC}") |
| 449 | print( |
| 450 | " • 'I need to implement a reinforcement learning algorithm for robotic control'" |
| 451 | ) |
| 452 | print( |
| 453 | " • 'Create a neural network for image classification with attention mechanisms'" |
| 454 | ) |
| 455 | print(f"{Colors.CYAN}Engineering Projects:{Colors.ENDC}") |
| 456 | print( |
| 457 | " • 'Develop a web application for project management with user authentication'" |
| 458 | ) |
| 459 | print(" • 'Create a data visualization dashboard for sales analytics'") |
| 460 | print(f"{Colors.CYAN}Mixed Projects:{Colors.ENDC}") |
| 461 | print( |
| 462 | " • 'Implement a machine learning model with a web interface for real-time predictions'" |
| 463 | ) |
| 464 | |
| 465 | self.print_separator("─", 79, Colors.PURPLE) |
| 466 | |
| 467 | print( |
| 468 | f"\n{Colors.BOLD}{Colors.OKCYAN}✏️ Enter your coding requirements below:{Colors.ENDC}" |
| 469 | ) |
| 470 | print( |
| 471 | f"{Colors.YELLOW}(Type your description, press Enter twice when finished, or Ctrl+C to cancel){Colors.ENDC}" |
| 472 | ) |
| 473 | |
| 474 | lines = [] |
| 475 | empty_line_count = 0 |
| 476 | |
| 477 | while True: |
| 478 | try: |
| 479 | if len(lines) == 0: |
| 480 | print(f"{Colors.BOLD}> {Colors.ENDC}", end="") |
| 481 | else: |
| 482 | print(f"{Colors.BOLD} {Colors.ENDC}", end="") |
| 483 | |
| 484 | line = input() |
| 485 | |
| 486 | if line.strip() == "": |
| 487 | empty_line_count += 1 |
| 488 | if empty_line_count >= 2: |
| 489 | # Two consecutive empty lines means user finished input |
| 490 | break |
| 491 | lines.append("") # Keep empty line for formatting |
no test coverage detected