diff --git a/app/AI.tsx b/app/AI.tsx index 597b629..80b1d7d 100644 --- a/app/AI.tsx +++ b/app/AI.tsx @@ -4,7 +4,7 @@ import InputBackend from './InputBackend'; const AI: React.FC = () => { return ( -
+
); diff --git a/app/Documentation.tsx b/app/Documentation.tsx index 3c7edd2..01b4b34 100644 --- a/app/Documentation.tsx +++ b/app/Documentation.tsx @@ -1,13 +1,124 @@ -// AI.tsx import React from 'react'; - -const AI: React.FC = () => { +const Documentation = () => { return ( -
-

hans

+
+
+

AI Virtual Assistant - Internship Students 2024

+

General planning:

+

+ We are currently in the process of developing a Python application that leverages HTML and CSS to create an intuitive graphical user interface (GUI). This application will integrate multiple AI models through API calls, enabling users to effortlessly switch between different models tailored for specific tasks, such as coding, mathematics, and language processing. A key feature of our design is that the application will be capable of running locally, ensuring that users can access its functionality without the need for an internet connection. +

+

+ Upon receiving our assignment, we initiated the project by outlining a detailed timeline for each task to ensure a structured approach to development. This timeline serves as a roadmap, helping us allocate resources effectively and track our progress. Following this planning phase, Patrick_Pluto took the lead in creating the repository, establishing a centralized location for our codebase. Meanwhile, Yasin and sageTheDM forked the repository to begin their contributions, allowing them to work on specific features and enhancements independently. +

+

+ As we move forward, our focus will be on refining the user experience, optimizing the integration of AI models, and ensuring that the application is robust and user-friendly. We are excited about the potential of this project and are committed to delivering a high-quality application that meets the needs of our users. +

+ +

Frontend planning:

+

+ We are committed to designing a visually appealing graphical user interface (GUI) that significantly enhances user experience and engagement. The GUI will prominently feature a chat function, allowing users to interact seamlessly with the AI Assistant. This conversational interface will facilitate easy communication, making it intuitive for users to ask questions and receive responses. +

+

+ To further improve usability, we will incorporate distinct buttons that enable users to switch effortlessly between online and offline modes. This functionality ensures that users can access the AI's capabilities regardless of their internet connectivity, making the application versatile and accommodating to various user environments. +

+

+ Additionally, the interface will provide options for users to select from a range of AI models, each tailored for specific use cases such as coding assistance, mathematical problem-solving, and language translation. This feature empowers users to choose the most suitable AI for their needs, thereby enhancing the overall effectiveness and relevance of the application. +

+

+ We will also prioritize creating an intuitive layout, ensuring that all elements are easily accessible and visually coherent. By focusing on user experience in our design, we aim to make the application not only functional but also enjoyable to use. Our goal is to create a user-friendly environment that encourages exploration and interaction, ultimately leading to a more satisfying and productive experience for all users. +

+ +

Draw.io:

+

Insert your Draw.io diagrams here.

+ +

Inspiration:

+

Describe your inspirations here.

+ +

First prototype:

+

+ After prototyping the Website we started working on optimizing the css and html structure, and combining the front and the backend together with each other using Flask. Since we have never once done that once it was more learning by doing than planning that is why we have not planned this step but documented it. +

+ +

Web APP

+

QtWebEngine 5

+

+ We decided on going with QtWebEngine, because Qt is cross platform, and easy to use. QtWebEngine is basically a slimmed down version of Chromium that runs on the Qt Widget Framework. It looked pretty good, but the browser part is very barebones, so it broke a lot of styling. +

+ +

Styling

+

+ After conducting thorough testing, we discovered that even after performing a browser reset, the web application exhibited a distinct styling compared to the web version. This inconsistency prompted us to undertake a comprehensive overhaul of the entire CSS framework. +

+

+ In our redesign, we focused on enhancing the user experience by implementing custom scrollbars that align with our overall aesthetic. Additionally, we expanded upon our existing design foundation to ensure a more cohesive and visually appealing interface. +

+

+ Our efforts have resulted in a web application that is not only visually consistent across different platforms but also optimized for performance. The revamped web app is designed to be responsive, making it accessible and functional on a wide range of devices, from desktops to tablets and smartphones. This adaptability ensures that users can enjoy a seamless experience, regardless of the device they choose to use. +

+

+ Overall, these improvements reflect our commitment to delivering a high-quality product that meets the diverse needs of our users while maintaining a polished and professional appearance. +

+ +

Prototype: 17.09.2024

+

+ Our current prototype operates on a straightforward Python backend, which, while functional, relies heavily on our optimism that it will remain stable and not encounter any critical failures or data loss. +

+

+ The existing chat system is equipped with several key features designed to enhance user interaction. Users can easily resend the AI's response, allowing for quick follow-up questions or clarifications. Additionally, the system provides the ability to edit user messages, ensuring that any mistakes can be corrected without starting the conversation anew. +

+

+ Furthermore, users have the option to copy the AI's responses, facilitating easy sharing or saving of information for future reference. These features aim to create a more flexible and user-friendly experience, allowing for seamless communication and interaction with the AI. +

+

+ While the current setup serves as a solid foundation, we recognize the need for further improvements and enhancements to ensure reliability and robustness as we move forward in the development process. +

+

+ Theoretically there is also voice recognition but let us ignore that for now. +

+ +

17.09.2024

+

+ After transitioning to React, we made several significant changes. We renamed our History and Models components to .left-panel, which can now be hidden when not in use. Additionally, with various optimizations through React, we’ve successfully split the CSS and HTML components into more manageable parts. +

+

+ We also made our first strides towards achieving a fully responsive website. With these changes, we are well on our way to completing the responsive design in the near future. +

+ +

Backend planning:

+

Task:

+

+ We will develop an extensible backend that enables us to easily swap out different AI models, facilitating the creation of a versatile AI Virtual Assistant. This architecture will allow for seamless integration of new AI technologies as they become available, ensuring that our application remains up-to-date and capable of meeting diverse user needs. +

+

+ The backend will also incorporate advanced features such as speech recognition, allowing users to interact with the AI Assistant through voice commands for a more natural and intuitive experience. Additionally, we will implement functionality to save chat histories, enabling users to revisit previous conversations and maintain continuity in their interactions with the AI. +

+

+ For the AI model, we will utilize Microsoft Phi 3.5, which offers robust capabilities for understanding and generating human-like responses. This choice will enhance the overall performance of the Virtual Assistant, making it a valuable tool for users seeking assistance across various tasks and topics. By combining an extensible backend with powerful AI capabilities, we aim to deliver a comprehensive and user-friendly virtual assistant experience. +

+ +

Design Philosophy:

+

+ Our design philosophy is to create one script file per feature. This allows us to possibly reuse certain features in other projects very easily, as we can copy the individual .py files, which all work on their own, except the specific .py file for this project, which is specially tailored towards this AI chatbot. +

+ +

UML diagrams:

+

Insert your UML diagrams here, one picture per diagram.

+ +

First Prototype:

+

+ You are able to simply select an AI Model, then type out what you want to ask. This Prototype is already ready to answer questions and detect what language you write in and give the answer in the corresponding language. +

+ +

Combining back and frontend

+

Flask setup

+

+ The flask setup was relatively quick. We had to adjust all of the file references, and add /static +

+
); }; -export default AI; +export default Documentation; diff --git a/app/Faq.tsx b/app/Faq.tsx index 8749689..5a274a9 100644 --- a/app/Faq.tsx +++ b/app/Faq.tsx @@ -1,13 +1,107 @@ -// AI.tsx import React from 'react'; - -const AI: React.FC = () => { +const FAQ: React.FC = () => { return ( -
-

Peter

-
+
+

Frequently Asked Questions

+ +
+

What is this AI assistant for?

+

This AI assistant helps you with various tasks such as answering questions, generating text, and even helping with code or writing tasks.

+
+ +
+

How does the AI assistant work?

+

The assistant uses machine learning algorithms to understand your input and provide contextually relevant answers or generate content based on the task you've described.

+
+ +
+

Can I trust the answers given by the AI assistant?

+

While the AI strives to give accurate and helpful answers, it is important to verify critical information, especially for complex or sensitive queries.

+
+ +
+

What kind of questions can I ask?

+

You can ask a wide range of questions from simple factual queries to more complex requests like generating creative writing or code snippets.

+
+ +
+

Is my data secure when using the AI assistant?

+

We take privacy seriously. Your data is handled according to our privacy policy, ensuring that any personal information shared is securely processed and not misused.

+
+ +
+

How can I provide feedback about the AI assistant?

+

Feedback can be provided through our feedback form, available on our website. We appreciate your input and use it to improve the AI assistant's performance.

+
+ +
+

Can I customize the AI assistant's responses?

+

Customization options are limited in the current version, but we are working on features that will allow users to tailor responses to better suit their needs.

+
+ +
+

How frequently is the AI assistant updated?

+

The AI assistant is updated regularly to improve its functionality and incorporate new features. Stay tuned to our update logs for information on the latest improvements.

+
+ +
+

What should I do if the AI assistant is not working properly?

+

If you encounter any issues with the AI assistant, please contact our support team for assistance. Provide details about the problem to help us resolve it quickly.

+
+ +
+

Will the AI assistant be available in multiple languages?

+

Yes, the AI assistant is designed to support multiple languages. You can specify your language preference in the settings to receive responses in your chosen language.

+
+ +
+

How can I integrate the AI assistant into my own application?

+

Integration guidelines are available in our developer documentation. Follow the instructions to incorporate the AI assistant into your application via our API.

+
+ +
+

Is there a mobile version of the AI assistant?

+

Currently, the AI assistant is optimized for desktop use. We are working on a mobile version to provide a seamless experience on smartphones and tablets.

+
+ +
+

Can the AI assistant handle multiple simultaneous conversations?

+

Yes, the AI assistant is capable of managing multiple conversations at once, ensuring that each interaction is handled efficiently.

+
+ +
+

What are the system requirements to use the AI assistant?

+

The AI assistant can be accessed through most modern web browsers. Ensure your browser is up-to-date for the best experience.

+
+ +
+

How can I access previous conversations?

+

Previous conversations can be accessed through the chat history feature available in the assistant's interface.

+
+ +
+

What are the limitations of the current AI assistant?

+

The AI assistant may have limitations in understanding highly specialized or nuanced topics. We are continuously working to expand its capabilities.

+
+ +
+

How do I update my profile or settings?

+

Profile and settings updates can be made through the account management section of the application. Ensure you save your changes before exiting.

+
+ +
+

Can the AI assistant be used offline?

+

Currently, the AI assistant requires an internet connection to function. Offline capabilities are being explored for future updates.

+
+ +
+

Who can I contact for technical support?

+

Technical support can be reached through our support contact page on the website. Our team is available to help with any technical issues you may encounter.

+
+ +
); }; -export default AI; +export default FAQ; diff --git a/app/Header.tsx b/app/Header.tsx index fbd14cb..1b28f1a 100644 --- a/app/Header.tsx +++ b/app/Header.tsx @@ -2,41 +2,36 @@ import React from 'react'; interface HeaderProps { - toggleDivs: () => void; - showDivs: boolean; onViewChange: (view: 'AI' | 'FAQ' | 'Documentation') => void; + showDivs: boolean; + toggleDivs: () => void; showHistoryModelsToggle: boolean; + showToggle: boolean; // Add this prop } -const Header: React.FC = ({ toggleDivs, showDivs, onViewChange, showHistoryModelsToggle }) => { +const Header: React.FC = ({ onViewChange, showDivs, toggleDivs, showHistoryModelsToggle, showToggle }) => { return (
-
-
    + -
+ )} +
); }; diff --git a/app/layout.tsx b/app/layout.tsx index a14e64f..da488bb 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -1,6 +1,9 @@ +import Header from "./Header"; + + export const metadata = { - title: 'Next.js', - description: 'Generated by Next.js', + title: 'AI Assistant | Interstellar Development', + description: 'A little AI chat that is able to assist you in little tasks', } export default function RootLayout({ @@ -10,7 +13,9 @@ export default function RootLayout({ }) { return ( - {children} + +
{children}
+ - ) + ); } diff --git a/app/page.tsx b/app/page.tsx index 583151e..54dccc1 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -1,10 +1,9 @@ -// LandingPage.tsx -"use client" +"use client"; import React, { useState, useEffect, useRef } from 'react'; import Header from './Header'; import AI from './AI'; -import FAQ from './Faq'; -import Documentation from './Documentation'; +import FAQ from './Faq'; // Ensure the import path is correct +import Documentation from './Documentation'; // Ensure the import path is correct import History from './History'; import Models from './Models'; import './styles/master.css'; @@ -45,32 +44,32 @@ const LandingPage: React.FC = () => { const handleViewChange = (view: 'AI' | 'FAQ' | 'Documentation') => { setView(view); - // Optionally hide the History/Models section when changing view if (view !== 'AI') { setShowDivs(false); } }; return ( -
+
-
- {view === 'AI' && ( -
+
+ {showDivs && ( +
)} -
- {view === 'AI' && } - {view === 'FAQ' && } - {view === 'Documentation' && } -
+
+
+ {view === 'AI' && } + {view === 'FAQ' && } + {view === 'Documentation' && }
); diff --git a/app/styles/container.css b/app/styles/container.css index 7170986..528c675 100644 --- a/app/styles/container.css +++ b/app/styles/container.css @@ -1,5 +1,6 @@ /* container.css */ -.container { +.container, +.content { padding-top: 10vh; display: flex; height: 100vh; @@ -10,60 +11,25 @@ .left-panel { width: 25vw; /* Adjust as needed */ - transition: width 0.3s ease, visibility 0.3s ease; /* Transition for width, opacity, and visibility */ + transition: width 0.3s ease, opacity 0.3s ease, visibility 0.3s ease; /* Smooth transitions for all properties */ } .left-panel.hidden { opacity: 0; /* Fade out when hidden */ - width: 0; /* Set width to 0 when hidden */ - visibility: hidden; /* Hide the panel while keeping the space occupied */ - margin-right: -30vw; + width: 0; /* Collapse width to 0 */ + visibility: hidden; /* Hide visibility while collapsing */ } .conversation-container { flex: 1; - transition: width 0.3s ease, visibility 0.3s ease; /* Transition for margin-left */ + transition: margin-left 0.3s ease; /* Smooth margin adjustment */ } /* Adjust margin-left when panel is shown or hidden */ .conversation-container.expanded { - margin-left: 0; + margin-left: 1vw; } .conversation-container.collapsed { - margin-left: 30vw; /* Same as the width of the left-panel */ -} - -/* container.css */ - -/* Overlay styles for Documentation and FAQ */ -.overlay { - position: fixed; /* Fixed positioning for overlay */ - top: 0; - left: 0; - width: 100vw; - height: 100vh; - background: rgba(0, 0, 0, 0.5); /* Semi-transparent background */ - z-index: 1000; /* Ensure it is above other content */ - display: none; /* Hidden by default */ - align-items: center; - justify-content: center; - color: white; /* Text color for better readability */ - padding: 20px; - box-sizing: border-box; -} - -/* Show overlay when active */ -.overlay.active { - display: flex; -} - -/* Specific styling for Documentation overlay */ -.overlay.documentation { - /* Add specific styles for Documentation overlay if needed */ -} - -/* Specific styling for FAQ overlay */ -.overlay.faq { - /* Add specific styles for FAQ overlay if needed */ + margin-left: 1vw; /* Space for the left panel */ } diff --git a/app/styles/doc.css b/app/styles/doc.css new file mode 100644 index 0000000..c8fd63e --- /dev/null +++ b/app/styles/doc.css @@ -0,0 +1,46 @@ +/* styles.css */ + +/* Styling for the documentation container */ +.documentation-container { + padding: 2rem; +} + +.documentation-section { + max-width: 900px; + height: 80vh; + margin: 0 auto; + background: #fff; + padding: 2rem; + border-radius: 8px; + box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); + overflow-y: scroll; +} + +.title { + font-size: 2rem; + color: #333; + margin-bottom: 1.5rem; +} + +.subtitle { + font-size: 1.5rem; + color: #555; + margin-top: 2rem; + margin-bottom: 1rem; +} + +.subsection-title { + font-size: 1.25rem; + color: #666; + margin-top: 1.5rem; + margin-bottom: 0.75rem; +} + +.paragraph { + font-size: 1rem; + color: #333; + margin-bottom: 1.5rem; + line-height: 1.6; +} + + diff --git a/app/styles/faq.css b/app/styles/faq.css index 99b28db..e3201d4 100644 --- a/app/styles/faq.css +++ b/app/styles/faq.css @@ -1,6 +1,51 @@ -.faq-background{ - width: 100vw; - height: 100vh; - color: white; - background-color: white; -} \ No newline at end of file +/* Make sure the parent container of #faq takes up the full viewport height */ +.faq-container { + display: flex; + justify-content: center; /* Center horizontally */ + align-items: center; /* Center vertically */ + height: 100vh; /* Full viewport height */ + padding: 0 10px; /* Optional padding to ensure spacing on small screens */ +} + +#faq { + max-width: 800px; + width: 90%; + padding: 20px; + background-color: #222; + border-radius: 10px; + box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3); + overflow-y: scroll; /* Allow vertical scrolling if content overflows */ + margin: 0 auto; + height: 80vh; +} + +#faq h2 { + text-align: center; + color: #00ccff; + font-size: 2em; + margin-bottom: 20px; +} + +.faq-item { + margin-bottom: 20px; + padding: 10px; + border-radius: 5px; + background-color: #333; +} + +.faq-item h3 { + color: #00ccff; + margin-bottom: 10px; + font-size: 1.5em; +} + +.faq-item p { + color: #ddd; + font-size: 1.1em; + line-height: 1.5; +} + +.faq-item:hover { + background-color: #444; + transition: background-color 0.3s; +} diff --git a/app/styles/master.css b/app/styles/master.css index 9223084..53fcff8 100644 --- a/app/styles/master.css +++ b/app/styles/master.css @@ -11,4 +11,5 @@ @import './input.css'; @import './faq.css'; @import './scrollbar.css'; +@import './doc.css'; @import './responsive.css'; diff --git a/app/styles/responsive.css b/app/styles/responsive.css index 4bb6554..9a3f687 100644 --- a/app/styles/responsive.css +++ b/app/styles/responsive.css @@ -54,4 +54,23 @@ margin-left: 0; } +} + +/* Responsive design adjustments */ +@media (max-width: 768px) { + .title { + font-size: 1.5rem; + } + + .subtitle { + font-size: 1.25rem; + } + + .subsection-title { + font-size: 1rem; + } + + .paragraph { + font-size: 0.9rem; + } } \ No newline at end of file diff --git a/app/styles/user-ai-messages.css b/app/styles/user-ai-messages.css index ccbd494..91a04d6 100644 --- a/app/styles/user-ai-messages.css +++ b/app/styles/user-ai-messages.css @@ -24,4 +24,4 @@ border-bottom-left-radius: 0; margin-right: auto; text-align: left; -} +} \ No newline at end of file