Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -424,418 +424,409 @@ def create_interface():
|
|
424 |
with gr.Blocks(
|
425 |
theme=gr.themes.Base(),
|
426 |
css="""
|
427 |
-
|
428 |
-
|
429 |
-
|
430 |
-
|
431 |
-
|
432 |
-
|
433 |
-
|
434 |
-
|
435 |
-
|
436 |
-
|
437 |
-
|
438 |
-
|
439 |
-
|
440 |
-
|
441 |
-
|
442 |
-
|
443 |
-
|
444 |
-
|
445 |
-
|
446 |
-
|
447 |
-
|
448 |
-
|
449 |
-
|
450 |
-
|
451 |
-
|
452 |
-
|
453 |
-
|
454 |
-
|
455 |
-
|
456 |
-
|
457 |
-
|
458 |
-
|
459 |
-
|
460 |
-
|
461 |
-
|
462 |
-
|
463 |
-
|
464 |
-
|
465 |
-
|
466 |
-
|
467 |
-
|
468 |
-
|
469 |
-
|
470 |
-
|
471 |
-
|
472 |
-
|
473 |
-
|
474 |
-
|
475 |
-
|
476 |
-
|
477 |
-
|
478 |
-
|
479 |
-
|
480 |
-
|
481 |
-
|
482 |
-
|
483 |
-
|
484 |
-
|
485 |
-
|
486 |
-
|
487 |
-
|
488 |
-
|
489 |
-
|
490 |
-
|
491 |
-
|
492 |
-
|
493 |
-
|
494 |
-
|
495 |
-
|
496 |
-
|
497 |
-
|
498 |
-
|
499 |
-
|
500 |
-
|
501 |
-
|
502 |
-
|
503 |
-
|
504 |
-
|
505 |
-
|
506 |
-
|
507 |
-
|
508 |
-
|
509 |
-
|
510 |
-
|
511 |
-
|
512 |
-
|
513 |
-
|
514 |
-
|
515 |
-
|
516 |
-
|
517 |
-
|
518 |
-
|
519 |
-
|
520 |
-
|
521 |
-
|
522 |
-
|
523 |
-
|
524 |
-
|
525 |
-
|
526 |
-
|
527 |
-
|
528 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
529 |
box-shadow:
|
530 |
0 0 30px rgba(255, 193, 7, 0.15),
|
531 |
0 8px 32px rgba(0, 0, 0, 0.3),
|
532 |
-
inset 0 1px 0 rgba(255, 255, 255, 0.05)
|
533 |
-
backdrop-filter: blur(20px) !important;
|
534 |
-
position: relative;
|
535 |
-
animation: chatGlow 4s ease-in-out infinite alternate;
|
536 |
-
}
|
537 |
-
|
538 |
-
@keyframes chatGlow {
|
539 |
-
0% {
|
540 |
-
box-shadow:
|
541 |
-
0 0 30px rgba(255, 193, 7, 0.15),
|
542 |
-
0 8px 32px rgba(0, 0, 0, 0.3),
|
543 |
-
inset 0 1px 0 rgba(255, 255, 255, 0.05);
|
544 |
-
}
|
545 |
-
100% {
|
546 |
-
box-shadow:
|
547 |
-
0 0 40px rgba(255, 193, 7, 0.25),
|
548 |
-
0 12px 40px rgba(0, 0, 0, 0.4),
|
549 |
-
inset 0 1px 0 rgba(255, 255, 255, 0.08);
|
550 |
-
}
|
551 |
-
}
|
552 |
-
|
553 |
-
/* Enhanced chat messages */
|
554 |
-
.message {
|
555 |
-
background: rgba(255, 255, 255, 0.05) !important;
|
556 |
-
border-radius: 16px !important;
|
557 |
-
padding: 1rem 1.5rem !important;
|
558 |
-
margin: 0.75rem 0 !important;
|
559 |
-
border: 1px solid rgba(255, 255, 255, 0.1) !important;
|
560 |
-
backdrop-filter: blur(10px) !important;
|
561 |
-
font-size: 0.95rem !important;
|
562 |
-
line-height: 1.6 !important;
|
563 |
-
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1) !important;
|
564 |
-
transition: all 0.3s ease !important;
|
565 |
-
}
|
566 |
-
|
567 |
-
.message:hover {
|
568 |
-
transform: translateY(-1px) !important;
|
569 |
-
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15) !important;
|
570 |
-
}
|
571 |
-
|
572 |
-
/* User message styling */
|
573 |
-
.message.user {
|
574 |
-
background: linear-gradient(135deg, rgba(255, 193, 7, 0.1), rgba(255, 193, 7, 0.05)) !important;
|
575 |
-
border-color: rgba(255, 193, 7, 0.2) !important;
|
576 |
-
margin-left: 15% !important;
|
577 |
-
box-shadow:
|
578 |
-
0 2px 10px rgba(255, 193, 7, 0.1),
|
579 |
-
inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
|
580 |
}
|
581 |
-
|
582 |
-
/* Assistant message styling */
|
583 |
-
.message.assistant {
|
584 |
-
background: linear-gradient(135deg, rgba(0, 123, 255, 0.08), rgba(0, 123, 255, 0.04)) !important;
|
585 |
-
border-color: rgba(0, 123, 255, 0.2) !important;
|
586 |
-
margin-right: 15% !important;
|
587 |
box-shadow:
|
588 |
-
0
|
589 |
-
|
|
|
590 |
}
|
591 |
-
|
592 |
-
|
593 |
-
|
594 |
-
|
595 |
-
|
596 |
-
|
597 |
-
|
598 |
-
|
599 |
-
|
600 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
601 |
box-shadow:
|
602 |
0 0 25px rgba(255, 193, 7, 0.1),
|
603 |
0 8px 32px rgba(0, 0, 0, 0.2),
|
604 |
inset 0 1px 0 rgba(255, 255, 255, 0.05);
|
605 |
-
animation: inputGlow 3s ease-in-out infinite alternate;
|
606 |
}
|
607 |
-
|
608 |
-
@keyframes inputGlow {
|
609 |
-
0% {
|
610 |
-
box-shadow:
|
611 |
-
0 0 25px rgba(255, 193, 7, 0.1),
|
612 |
-
0 8px 32px rgba(0, 0, 0, 0.2),
|
613 |
-
inset 0 1px 0 rgba(255, 255, 255, 0.05);
|
614 |
-
}
|
615 |
-
100% {
|
616 |
-
box-shadow:
|
617 |
-
0 0 35px rgba(255, 193, 7, 0.2),
|
618 |
-
0 12px 40px rgba(0, 0, 0, 0.3),
|
619 |
-
inset 0 1px 0 rgba(255, 255, 255, 0.08);
|
620 |
-
}
|
621 |
-
}
|
622 |
-
|
623 |
-
/* Enhanced File upload area */
|
624 |
-
.upload-area {
|
625 |
-
background: linear-gradient(135deg, rgba(255, 193, 7, 0.08), rgba(255, 193, 7, 0.04)) !important;
|
626 |
-
border: 2px dashed rgba(255, 193, 7, 0.4) !important;
|
627 |
-
border-radius: 16px !important;
|
628 |
-
padding: 1.5rem !important;
|
629 |
-
margin-bottom: 1.5rem !important;
|
630 |
-
transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
|
631 |
-
backdrop-filter: blur(10px) !important;
|
632 |
-
box-shadow:
|
633 |
-
0 0 20px rgba(255, 193, 7, 0.05),
|
634 |
-
inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
|
635 |
-
}
|
636 |
-
|
637 |
-
.upload-area:hover {
|
638 |
-
background: linear-gradient(135deg, rgba(255, 193, 7, 0.12), rgba(255, 193, 7, 0.06)) !important;
|
639 |
-
border-color: rgba(255, 193, 7, 0.6) !important;
|
640 |
-
box-shadow:
|
641 |
-
0 0 30px rgba(255, 193, 7, 0.15),
|
642 |
-
inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
|
643 |
-
transform: translateY(-2px) !important;
|
644 |
-
}
|
645 |
-
|
646 |
-
/* Sidebar styling */
|
647 |
-
.sidebar {
|
648 |
-
background: rgba(30, 30, 30, 0.6) !important;
|
649 |
-
border-right: 2px solid rgba(255, 193, 7, 0.1) !important;
|
650 |
-
backdrop-filter: blur(15px) !important;
|
651 |
box-shadow:
|
652 |
-
|
653 |
-
|
|
|
654 |
}
|
655 |
-
|
656 |
-
|
657 |
-
|
658 |
-
|
659 |
-
|
660 |
-
|
661 |
-
|
662 |
-
|
663 |
-
|
664 |
-
|
665 |
-
|
666 |
-
|
667 |
-
|
668 |
-
|
669 |
-
|
670 |
-
|
671 |
-
|
672 |
-
|
673 |
-
|
674 |
-
|
675 |
-
|
676 |
-
|
677 |
-
|
678 |
-
|
679 |
-
|
680 |
-
|
681 |
-
|
682 |
-
|
683 |
-
|
684 |
-
|
685 |
-
|
686 |
-
|
687 |
-
|
688 |
-
|
689 |
-
|
690 |
-
|
691 |
-
|
692 |
-
|
693 |
-
|
694 |
-
|
695 |
-
|
696 |
-
|
697 |
-
|
698 |
-
|
699 |
-
|
700 |
-
|
701 |
-
|
702 |
-
|
703 |
-
|
704 |
-
|
705 |
-
|
706 |
-
|
707 |
-
|
708 |
-
|
709 |
-
|
710 |
-
|
711 |
-
|
712 |
-
|
713 |
-
|
714 |
-
|
715 |
-
|
716 |
-
|
717 |
-
|
718 |
-
|
719 |
-
|
720 |
-
|
721 |
-
|
722 |
-
|
723 |
-
|
724 |
-
|
725 |
-
|
726 |
-
|
727 |
-
|
728 |
-
|
729 |
-
|
730 |
-
|
731 |
-
|
732 |
-
|
733 |
-
|
734 |
-
|
735 |
-
|
736 |
-
|
737 |
-
|
738 |
-
|
739 |
-
|
740 |
-
|
741 |
-
|
742 |
-
|
743 |
-
|
744 |
-
|
745 |
-
|
746 |
-
|
747 |
-
|
748 |
-
|
749 |
-
|
750 |
-
|
751 |
-
|
752 |
-
|
753 |
-
|
754 |
-
|
755 |
-
|
756 |
-
|
757 |
-
|
758 |
-
|
759 |
-
|
760 |
-
|
761 |
-
|
762 |
-
|
763 |
-
|
764 |
-
|
765 |
-
|
766 |
-
|
767 |
-
|
768 |
-
|
769 |
-
|
770 |
-
|
771 |
-
|
772 |
-
|
773 |
-
|
774 |
-
|
775 |
-
|
776 |
-
|
777 |
-
|
778 |
-
|
779 |
-
|
780 |
-
|
781 |
-
|
782 |
-
|
783 |
-
|
784 |
-
|
785 |
-
|
786 |
-
|
787 |
-
|
788 |
-
|
789 |
-
|
790 |
-
}
|
791 |
-
|
792 |
-
|
793 |
-
|
794 |
-
|
795 |
-
|
796 |
-
|
797 |
-
|
798 |
-
|
799 |
-
|
800 |
-
|
801 |
-
|
802 |
-
|
803 |
-
|
804 |
-
|
805 |
-
|
806 |
-
|
807 |
-
|
808 |
-
|
809 |
-
|
810 |
-
|
811 |
-
|
812 |
-
|
813 |
-
|
814 |
-
|
815 |
-
.
|
816 |
-
|
817 |
-
|
818 |
-
|
819 |
-
|
820 |
-
|
821 |
-
|
822 |
-
|
823 |
-
|
824 |
-
|
825 |
-
|
826 |
-
|
827 |
-
|
828 |
-
|
829 |
-
|
830 |
-
|
831 |
-
|
832 |
-
|
833 |
-
|
834 |
-
|
835 |
-
|
836 |
-
|
837 |
-
|
838 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
839 |
title="Agentic RAG Assistant"
|
840 |
) as iface:
|
841 |
|
@@ -879,7 +870,7 @@ def create_interface():
|
|
879 |
- **LLMAgent**: Response generation
|
880 |
- **CoordinatorAgent**: Workflow orchestration
|
881 |
|
882 |
-
|
883 |
- Streaming responses
|
884 |
- Multi-format support
|
885 |
- Context-aware answers
|
@@ -896,14 +887,14 @@ def create_interface():
|
|
896 |
elem_classes=["gradio-chatbot"],
|
897 |
show_copy_button=True,
|
898 |
type="messages",
|
899 |
-
placeholder="
|
900 |
avatar_images=("👤", "🤖")
|
901 |
)
|
902 |
|
903 |
# Input area with improved layout
|
904 |
with gr.Row(elem_classes=["input-row"]):
|
905 |
msg_input = gr.Textbox(
|
906 |
-
placeholder="
|
907 |
label="Message",
|
908 |
scale=4,
|
909 |
elem_classes=["message-input"],
|
|
|
424 |
with gr.Blocks(
|
425 |
theme=gr.themes.Base(),
|
426 |
css="""
|
427 |
+
/* Import Google Fonts for better typography */
|
428 |
+
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
|
429 |
+
|
430 |
+
/* Dark theme styling with enhanced visuals */
|
431 |
+
.gradio-container {
|
432 |
+
background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 50%, #16213e 100%) !important;
|
433 |
+
color: #ffffff !important; /* Ensure base text color is bright */
|
434 |
+
height: 100vh !important;
|
435 |
+
max-width: none !important;
|
436 |
+
padding: 0 !important;
|
437 |
+
font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
|
438 |
+
}
|
439 |
+
|
440 |
+
/* Main container with animated background */
|
441 |
+
.main-container {
|
442 |
+
display: flex;
|
443 |
+
flex-direction: column;
|
444 |
+
height: 100vh;
|
445 |
+
background:
|
446 |
+
radial-gradient(circle at 20% 50%, rgba(255, 193, 7, 0.05) 0%, transparent 50%),
|
447 |
+
radial-gradient(circle at 80% 20%, rgba(0, 123, 255, 0.05) 0%, transparent 50%),
|
448 |
+
radial-gradient(circle at 40% 80%, rgba(255, 87, 34, 0.03) 0%, transparent 50%),
|
449 |
+
linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 50%, #16213e 100%);
|
450 |
+
animation: backgroundShift 15s ease-in-out infinite alternate;
|
451 |
+
}
|
452 |
+
|
453 |
+
@keyframes backgroundShift {
|
454 |
+
0% { filter: hue-rotate(0deg); }
|
455 |
+
100% { filter: hue-rotate(10deg); }
|
456 |
+
}
|
457 |
+
|
458 |
+
/* Enhanced Header with glow */
|
459 |
+
.header {
|
460 |
+
background: rgba(255, 193, 7, 0.08);
|
461 |
+
border-bottom: 2px solid transparent;
|
462 |
+
border-image: linear-gradient(90deg, rgba(255, 193, 7, 0.5), rgba(0, 123, 255, 0.3)) 1;
|
463 |
+
padding: 1.5rem 2rem;
|
464 |
+
backdrop-filter: blur(20px);
|
465 |
+
box-shadow:
|
466 |
+
0 4px 20px rgba(255, 193, 7, 0.1),
|
467 |
+
inset 0 1px 0 rgba(255, 255, 255, 0.1);
|
468 |
+
position: relative;
|
469 |
+
overflow: hidden;
|
470 |
+
}
|
471 |
+
|
472 |
+
.header::before {
|
473 |
+
content: '';
|
474 |
+
position: absolute;
|
475 |
+
top: 0;
|
476 |
+
left: -100%;
|
477 |
+
width: 100%;
|
478 |
+
height: 100%;
|
479 |
+
background: linear-gradient(90deg, transparent, rgba(255, 193, 7, 0.1), transparent);
|
480 |
+
animation: shimmer 3s ease-in-out infinite;
|
481 |
+
}
|
482 |
+
|
483 |
+
@keyframes shimmer {
|
484 |
+
0% { left: -100%; }
|
485 |
+
100% { left: 100%; }
|
486 |
+
}
|
487 |
+
|
488 |
+
.header h1 {
|
489 |
+
color: #ffc107;
|
490 |
+
margin: 0;
|
491 |
+
font-size: 2rem;
|
492 |
+
font-weight: 700;
|
493 |
+
text-shadow:
|
494 |
+
0 0 10px rgba(255, 193, 7, 0.3),
|
495 |
+
0 0 20px rgba(255, 193, 7, 0.2);
|
496 |
+
letter-spacing: -0.02em;
|
497 |
+
}
|
498 |
+
|
499 |
+
.header p {
|
500 |
+
color: #e0e0e0;
|
501 |
+
margin: 0.5rem 0 0 0;
|
502 |
+
font-size: 1rem;
|
503 |
+
font-weight: 400;
|
504 |
+
opacity: 0.9;
|
505 |
+
}
|
506 |
+
|
507 |
+
/* Enhanced Chat container */
|
508 |
+
.chat-container {
|
509 |
+
flex: 1;
|
510 |
+
display: flex;
|
511 |
+
flex-direction: column;
|
512 |
+
max-width: 1200px;
|
513 |
+
margin: 0 auto;
|
514 |
+
width: 100%;
|
515 |
+
padding: 2rem;
|
516 |
+
height: calc(100vh - 200px) !important;
|
517 |
+
gap: 1.5rem;
|
518 |
+
}
|
519 |
+
|
520 |
+
/* Enhanced Chatbot with glow effect */
|
521 |
+
.gradio-chatbot {
|
522 |
+
height: 400px !important;
|
523 |
+
max-height: 400px !important;
|
524 |
+
background: rgba(45, 45, 45, 0.4) !important;
|
525 |
+
border: 2px solid rgba(255, 193, 7, 0.2) !important;
|
526 |
+
border-radius: 20px !important;
|
527 |
+
margin-bottom: 1rem;
|
528 |
+
overflow-y: auto !important;
|
529 |
+
box-shadow:
|
530 |
+
0 0 30px rgba(255, 193, 7, 0.15),
|
531 |
+
0 8px 32px rgba(0, 0, 0, 0.3),
|
532 |
+
inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
|
533 |
+
backdrop-filter: blur(20px) !important;
|
534 |
+
position: relative;
|
535 |
+
animation: chatGlow 4s ease-in-out infinite alternate;
|
536 |
+
}
|
537 |
+
|
538 |
+
@keyframes chatGlow {
|
539 |
+
0% {
|
540 |
box-shadow:
|
541 |
0 0 30px rgba(255, 193, 7, 0.15),
|
542 |
0 8px 32px rgba(0, 0, 0, 0.3),
|
543 |
+
inset 0 1px 0 rgba(255, 255, 255, 0.05);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
544 |
}
|
545 |
+
100% {
|
|
|
|
|
|
|
|
|
|
|
546 |
box-shadow:
|
547 |
+
0 0 40px rgba(255, 193, 7, 0.25),
|
548 |
+
0 12px 40px rgba(0, 0, 0, 0.4),
|
549 |
+
inset 0 1px 0 rgba(255, 255, 255, 0.08);
|
550 |
}
|
551 |
+
}
|
552 |
+
|
553 |
+
/* Enhanced chat messages */
|
554 |
+
.message {
|
555 |
+
background: rgba(255, 255, 255, 0.05) !important;
|
556 |
+
border-radius: 16px !important;
|
557 |
+
padding: 1rem 1.5rem !important;
|
558 |
+
margin: 0.75rem 0 !important;
|
559 |
+
border: 1px solid rgba(255, 255, 255, 0.1) !important;
|
560 |
+
backdrop-filter: blur(10px) !important;
|
561 |
+
font-size: 0.95rem !important;
|
562 |
+
line-height: 1.6 !important;
|
563 |
+
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1) !important;
|
564 |
+
transition: all 0.3s ease !important;
|
565 |
+
color: #ffffff !important; /* Made brighter for all messages */
|
566 |
+
}
|
567 |
+
|
568 |
+
.message:hover {
|
569 |
+
transform: translateY(-1px) !important;
|
570 |
+
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15) !important;
|
571 |
+
}
|
572 |
+
|
573 |
+
/* User message styling */
|
574 |
+
.message.user {
|
575 |
+
background: linear-gradient(135deg, rgba(255, 193, 7, 0.1), rgba(255, 193, 7, 0.05)) !important;
|
576 |
+
border-color: rgba(255, 193, 7, 0.2) !important;
|
577 |
+
margin-left: 15% !important;
|
578 |
+
box-shadow:
|
579 |
+
0 2px 10px rgba(255, 193, 7, 0.1),
|
580 |
+
inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
|
581 |
+
}
|
582 |
+
|
583 |
+
/* Assistant message styling - important for streaming text */
|
584 |
+
.message.assistant {
|
585 |
+
background: linear-gradient(135deg, rgba(0, 123, 255, 0.08), rgba(0, 123, 255, 0.04)) !important;
|
586 |
+
border-color: rgba(0, 123, 255, 0.2) !important;
|
587 |
+
margin-right: 15% !important;
|
588 |
+
box-shadow:
|
589 |
+
0 2px 10px rgba(0, 123, 255, 0.1),
|
590 |
+
inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
|
591 |
+
color: #ffffff !important; /* Ensures generated text is bright white */
|
592 |
+
}
|
593 |
+
|
594 |
+
/* Enhanced Input area with glow */
|
595 |
+
.input-area {
|
596 |
+
background: rgba(45, 45, 45, 0.6);
|
597 |
+
border-radius: 20px;
|
598 |
+
padding: 1.5rem;
|
599 |
+
border: 2px solid rgba(255, 193, 7, 0.2);
|
600 |
+
backdrop-filter: blur(20px);
|
601 |
+
position: sticky;
|
602 |
+
bottom: 0;
|
603 |
+
box-shadow:
|
604 |
+
0 0 25px rgba(255, 193, 7, 0.1),
|
605 |
+
0 8px 32px rgba(0, 0, 0, 0.2),
|
606 |
+
inset 0 1px 0 rgba(255, 255, 255, 0.05);
|
607 |
+
animation: inputGlow 3s ease-in-out infinite alternate;
|
608 |
+
}
|
609 |
+
|
610 |
+
@keyframes inputGlow {
|
611 |
+
0% {
|
612 |
box-shadow:
|
613 |
0 0 25px rgba(255, 193, 7, 0.1),
|
614 |
0 8px 32px rgba(0, 0, 0, 0.2),
|
615 |
inset 0 1px 0 rgba(255, 255, 255, 0.05);
|
|
|
616 |
}
|
617 |
+
100% {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
618 |
box-shadow:
|
619 |
+
0 0 35px rgba(255, 193, 7, 0.2),
|
620 |
+
0 12px 40px rgba(0, 0, 0, 0.3),
|
621 |
+
inset 0 1px 0 rgba(255, 255, 255, 0.08);
|
622 |
}
|
623 |
+
}
|
624 |
+
|
625 |
+
/* Enhanced File upload area */
|
626 |
+
.upload-area {
|
627 |
+
background: linear-gradient(135deg, rgba(255, 193, 7, 0.08), rgba(255, 193, 7, 0.04)) !important;
|
628 |
+
border: 2px dashed rgba(255, 193, 7, 0.4) !important;
|
629 |
+
border-radius: 16px !important;
|
630 |
+
padding: 1.5rem !important;
|
631 |
+
margin-bottom: 1.5rem !important;
|
632 |
+
transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
|
633 |
+
backdrop-filter: blur(10px) !important;
|
634 |
+
box-shadow:
|
635 |
+
0 0 20px rgba(255, 193, 7, 0.05),
|
636 |
+
inset 0 1px 0 rgba(255, 255, 255, 0.05) !important;
|
637 |
+
}
|
638 |
+
|
639 |
+
.upload-area:hover {
|
640 |
+
background: linear-gradient(135deg, rgba(255, 193, 7, 0.12), rgba(255, 193, 7, 0.06)) !important;
|
641 |
+
border-color: rgba(255, 193, 7, 0.6) !important;
|
642 |
+
box-shadow:
|
643 |
+
0 0 30px rgba(255, 193, 7, 0.15),
|
644 |
+
inset 0 1px 0 rgba(255, 255, 255, 0.08) !important;
|
645 |
+
transform: translateY(-2px) !important;
|
646 |
+
}
|
647 |
+
|
648 |
+
/* Sidebar styling */
|
649 |
+
.sidebar {
|
650 |
+
background: rgba(30, 30, 30, 0.6) !important;
|
651 |
+
border-right: 2px solid rgba(255, 193, 7, 0.1) !important;
|
652 |
+
backdrop-filter: blur(15px) !important;
|
653 |
+
box-shadow:
|
654 |
+
inset -1px 0 0 rgba(255, 255, 255, 0.05),
|
655 |
+
4px 0 20px rgba(0, 0, 0, 0.1) !important;
|
656 |
+
}
|
657 |
+
|
658 |
+
/* Enhanced buttons with glow effects */
|
659 |
+
.send-btn {
|
660 |
+
background: linear-gradient(135deg, #ffc107 0%, #ff8f00 100%) !important;
|
661 |
+
color: #000000 !important;
|
662 |
+
border: none !important;
|
663 |
+
border-radius: 12px !important;
|
664 |
+
font-weight: 600 !important;
|
665 |
+
min-height: 48px !important;
|
666 |
+
font-size: 0.95rem !important;
|
667 |
+
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
|
668 |
+
box-shadow:
|
669 |
+
0 4px 15px rgba(255, 193, 7, 0.3),
|
670 |
+
0 0 20px rgba(255, 193, 7, 0.2) !important;
|
671 |
+
position: relative;
|
672 |
+
overflow: hidden;
|
673 |
+
}
|
674 |
+
|
675 |
+
.send-btn::before {
|
676 |
+
content: '';
|
677 |
+
position: absolute;
|
678 |
+
top: 0;
|
679 |
+
left: -100%;
|
680 |
+
width: 100%;
|
681 |
+
height: 100%;
|
682 |
+
background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
|
683 |
+
transition: left 0.5s;
|
684 |
+
}
|
685 |
+
|
686 |
+
.send-btn:hover::before {
|
687 |
+
left: 100%;
|
688 |
+
}
|
689 |
+
|
690 |
+
.send-btn:hover {
|
691 |
+
transform: translateY(-2px) !important;
|
692 |
+
box-shadow:
|
693 |
+
0 8px 25px rgba(255, 193, 7, 0.4),
|
694 |
+
0 0 30px rgba(255, 193, 7, 0.3) !important;
|
695 |
+
}
|
696 |
+
|
697 |
+
.primary-btn {
|
698 |
+
background: linear-gradient(135deg, #ffc107 0%, #ff8f00 100%) !important;
|
699 |
+
color: #000000 !important;
|
700 |
+
border: none !important;
|
701 |
+
border-radius: 12px !important;
|
702 |
+
font-weight: 600 !important;
|
703 |
+
padding: 0.75rem 1.5rem !important;
|
704 |
+
font-size: 0.95rem !important;
|
705 |
+
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
|
706 |
+
box-shadow:
|
707 |
+
0 4px 15px rgba(255, 193, 7, 0.3),
|
708 |
+
0 0 20px rgba(255, 193, 7, 0.2) !important;
|
709 |
+
}
|
710 |
+
|
711 |
+
.primary-btn:hover {
|
712 |
+
transform: translateY(-2px) !important;
|
713 |
+
box-shadow:
|
714 |
+
0 8px 25px rgba(255, 193, 7, 0.4),
|
715 |
+
0 0 30px rgba(255, 193, 7, 0.3) !important;
|
716 |
+
}
|
717 |
+
|
718 |
+
/* Enhanced Text inputs with glow */
|
719 |
+
.gradio-textbox input, .gradio-textbox textarea {
|
720 |
+
background: rgba(45, 45, 45, 0.8) !important;
|
721 |
+
color: #ffffff !important;
|
722 |
+
border: 2px solid rgba(255, 193, 7, 0.2) !important;
|
723 |
+
border-radius: 12px !important;
|
724 |
+
font-size: 0.95rem !important;
|
725 |
+
padding: 0.75rem 1rem !important;
|
726 |
+
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
|
727 |
+
backdrop-filter: blur(10px) !important;
|
728 |
+
box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1) !important;
|
729 |
+
}
|
730 |
+
|
731 |
+
.gradio-textbox input:focus, .gradio-textbox textarea:focus {
|
732 |
+
border-color: rgba(255, 193, 7, 0.5) !important;
|
733 |
+
box-shadow:
|
734 |
+
0 0 20px rgba(255, 193, 7, 0.2),
|
735 |
+
inset 0 2px 4px rgba(0, 0, 0, 0.1) !important;
|
736 |
+
outline: none !important;
|
737 |
+
}
|
738 |
+
|
739 |
+
/* Enhanced Processing indicator */
|
740 |
+
.processing-indicator {
|
741 |
+
background: linear-gradient(135deg, rgba(255, 193, 7, 0.15), rgba(255, 193, 7, 0.08));
|
742 |
+
border: 2px solid rgba(255, 193, 7, 0.3);
|
743 |
+
border-radius: 12px;
|
744 |
+
padding: 1rem 1.5rem;
|
745 |
+
margin: 1rem 0;
|
746 |
+
color: #ffc107;
|
747 |
+
text-align: center;
|
748 |
+
font-weight: 500;
|
749 |
+
backdrop-filter: blur(10px);
|
750 |
+
box-shadow:
|
751 |
+
0 0 25px rgba(255, 193, 7, 0.1),
|
752 |
+
inset 0 1px 0 rgba(255, 255, 255, 0.1);
|
753 |
+
animation: processingPulse 2s ease-in-out infinite;
|
754 |
+
}
|
755 |
+
|
756 |
+
@keyframes processingPulse {
|
757 |
+
0%, 100% { opacity: 1; }
|
758 |
+
50% { opacity: 0.8; }
|
759 |
+
}
|
760 |
+
|
761 |
+
/* Enhanced Input row styling */
|
762 |
+
.input-row {
|
763 |
+
display: flex !important;
|
764 |
+
gap: 12px !important;
|
765 |
+
align-items: end !important;
|
766 |
+
}
|
767 |
+
|
768 |
+
/* Message input */
|
769 |
+
.message-input {
|
770 |
+
flex: 1 !important;
|
771 |
+
min-height: 48px !important;
|
772 |
+
}
|
773 |
+
|
774 |
+
/* Markdown content styling - applies to text within gr.Markdown components */
|
775 |
+
.markdown-content {
|
776 |
+
color: #e0e0e0 !important; /* Made brighter for general markdown text */
|
777 |
+
line-height: 1.6 !important;
|
778 |
+
font-size: 0.95rem !important;
|
779 |
+
}
|
780 |
+
|
781 |
+
.markdown-content h1, .markdown-content h2, .markdown-content h3 {
|
782 |
+
color: #ffc107 !important;
|
783 |
+
margin-top: 1.5rem !important;
|
784 |
+
margin-bottom: 0.5rem !important;
|
785 |
+
}
|
786 |
+
|
787 |
+
.markdown-content code {
|
788 |
+
background: rgba(255, 193, 7, 0.1) !important;
|
789 |
+
color: #ffc107 !important;
|
790 |
+
padding: 0.2rem 0.4rem !important;
|
791 |
+
border-radius: 4px !important;
|
792 |
+
}
|
793 |
+
|
794 |
+
.markdown-content pre {
|
795 |
+
background: rgba(0, 0, 0, 0.3) !important;
|
796 |
+
border: 1px solid rgba(255, 193, 7, 0.2) !important;
|
797 |
+
border-radius: 8px !important;
|
798 |
+
padding: 1rem !important;
|
799 |
+
margin: 1rem 0 !important;
|
800 |
+
}
|
801 |
+
|
802 |
+
/* Examples styling */
|
803 |
+
.examples {
|
804 |
+
background: rgba(45, 45, 45, 0.3) !important;
|
805 |
+
border-radius: 12px !important;
|
806 |
+
padding: 1rem !important;
|
807 |
+
border: 1px solid rgba(255, 193, 7, 0.1) !important;
|
808 |
+
backdrop-filter: blur(10px) !important;
|
809 |
+
color: #e0e0e0 !important; /* Explicitly set for examples text */
|
810 |
+
}
|
811 |
+
|
812 |
+
/* General paragraph text and Gradio HTML components (for architecture text) */
|
813 |
+
.gradio-container p,
|
814 |
+
.gradio-container .gr-html {
|
815 |
+
color: #e0e0e0 !important; /* Ensures general text is visible */
|
816 |
+
}
|
817 |
+
|
818 |
+
/* Loading animation */
|
819 |
+
@keyframes loading {
|
820 |
+
0% { transform: rotate(0deg); }
|
821 |
+
100% { transform: rotate(360deg); }
|
822 |
+
}
|
823 |
+
|
824 |
+
.loading {
|
825 |
+
animation: loading 2s linear infinite;
|
826 |
+
}
|
827 |
+
|
828 |
+
/* Responsive design */
|
829 |
+
""",
|
830 |
title="Agentic RAG Assistant"
|
831 |
) as iface:
|
832 |
|
|
|
870 |
- **LLMAgent**: Response generation
|
871 |
- **CoordinatorAgent**: Workflow orchestration
|
872 |
|
873 |
+
**Features:**
|
874 |
- Streaming responses
|
875 |
- Multi-format support
|
876 |
- Context-aware answers
|
|
|
887 |
elem_classes=["gradio-chatbot"],
|
888 |
show_copy_button=True,
|
889 |
type="messages",
|
890 |
+
placeholder="Upload documents , then start chatting! Ask me anything about your documents.",
|
891 |
avatar_images=("👤", "🤖")
|
892 |
)
|
893 |
|
894 |
# Input area with improved layout
|
895 |
with gr.Row(elem_classes=["input-row"]):
|
896 |
msg_input = gr.Textbox(
|
897 |
+
placeholder="Ask about your documents...",
|
898 |
label="Message",
|
899 |
scale=4,
|
900 |
elem_classes=["message-input"],
|