-
Notifications
You must be signed in to change notification settings - Fork 0
Unity-Lab-AI/Chat2
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
## Environment Setup Configure a `POLLINATIONS_TOKEN` secret in the repository settings. The deployment injects this value into `window.POLLINATIONS_TOKEN`, so the static site can access it directly without local files or storage. Here's a comprehensive breakdown of your web app's functionality based on the provided files: --- ## **General Overview** Your web application, titled **"Unity Chat U1 6.6"**, provides an interactive chat interface integrating multiple sophisticated features to enhance user interaction with AI models, manage conversations, personalize experiences, and dynamically handle multimedia elements like voice synthesis, speech recognition, and automated image generation via Pollinations. --- ## **Core Features** ### **1. Chat Interface** - **Real-time Conversations:** Allows users to communicate with AI-powered models, facilitating dynamic, real-time interactions. - **Speech Integration:** - **Speech Synthesis:** Converts AI responses into spoken audio with selectable voice preferences (`Google UK English Female`, `Microsoft Zira`, etc.). - **Speech Recognition:** Users can dictate messages through voice input, which captures speech and translates it into textual inputs in real-time. - **Message Handling:** - **Markdown Support:** AI-generated responses utilize Markdown, enhanced with syntax highlighting (via PrismJS) for clarity in code snippets. - **Image Embedding:** Automatically embeds images generated by Pollinations based on AI conversation content. - **Editing and Regeneration:** Users can edit their messages or regenerate AI responses conveniently from within the chat interface. - **Session Management:** - **Dynamic Session Handling:** Users can create, rename, delete, and switch between multiple chat sessions, each independently maintaining its conversation history. - **Automatic Title Generation:** Sessions automatically generate concise titles based on initial exchanges for easier identification. ### **2. Personalization & Memory** - **Memory Management:** - Integration with `memory-api.js` provides persistent memory storage, allowing users to store, manage, edit, and delete memories within the interface. - Prevents duplicate entries, ensuring organized memory storage. - **Personalization Options:** - Users can specify their name, interests, preferred AI behaviors, and additional information. These details are stored locally and leveraged by the AI to tailor responses uniquely to the user's profile. ### **3. Screensaver Module** - An integrated dynamic screensaver feature powered by Pollinations, capable of generating visually appealing images based on user-defined prompts. - Users have control over settings: - **Prompt:** Textual descriptions to generate specific imagery. - **Aspect Ratios:** Supports widescreen, square, and portrait modes. - **Timing Control:** Interval customization for image rotation. - **Privacy Options:** Controls image visibility on public feeds. - Provides direct download, save, and copy-to-clipboard functionalities for displayed screensaver images. ### **4. Backend Server** - **Express Server (`server.js`):** - Provides APIs for: - **User Registration:** Registers and tracks unique user IDs, storing them persistently (`userData.json`). - **Visitor Counting:** Returns real-time visitor statistics. - **Ubuntu Deployment Guide:** - Comprehensive server setup instructions (`Server setup.txt`), guiding deployment using Node.js, npm, PM2 (for process management), firewall setup (`ufw`), and optional reverse proxy configurations via Nginx/Apache. ### **5. Storage & Persistence (`storage.js`)** - Manages session data, memory entries, and user personalization details locally (`localStorage`), ensuring persistent state across user sessions. - Implements fallback mechanisms in case server-side persistence is unavailable, ensuring robustness and offline capability. ### **6. UI & Themes** - **Customizable UI:** - Employs Bootstrap 5, custom stylesheets (`styles.css` and `light.css`), and Font Awesome for iconography. - Supports dynamic theme switching (e.g., light, dark, hacker, etc.), catering to varied user aesthetics and readability preferences. - **Responsive Design:** - Ensures usability across various screen sizes (mobile, tablet, desktop), maintaining optimal user experience irrespective of device. ### **7. Utilities & Enhancements** - **Clipboard Functionality:** Allows easy copying of cryptocurrency addresses, images, and text snippets directly from the interface. - **Donation Integration:** - Direct integration of donation mechanisms supporting cryptocurrencies like BTC, ETH, DOGE, and XMR, accessible through intuitive modals. - **Visitor Counter:** - Displays a live count of unique visitors through periodic server API polling, defaulting gracefully in case of network issues. - **Error Handling & Notifications:** - User-friendly toast notifications (`showToast`) provide real-time feedback on interactions like successful copying, memory updates, errors, etc. --- ## **Technical Stack & Dependencies** - **Frontend:** HTML, CSS, JavaScript, Bootstrap 5, Font Awesome, PrismJS, Marked.js - **Backend:** Node.js (Express), cors, fs for file operations - **Speech & Multimedia:** Web Speech API for speech synthesis and recognition - **Persistent Storage:** Local Storage and server-side JSON file storage (`userData.json`) - **Deployment Tools:** Ubuntu server, Node.js, npm, PM2 for daemonization, ufw firewall configurations --- ## **Usage Workflow** - **Launching:** - User connects via the web interface hosted on the Node.js Express server. - Automatic unique ID generation and session initialization occur upon first load. - **Interacting:** - Engage via text or voice, manage sessions, personalize AI interactions, and explore dynamically generated imagery. - **Administration & Maintenance:** - Administer sessions, clear memory or chat history, configure UI preferences, monitor user statistics, and manage server through provided server scripts. --- ## **Security & Privacy** - Persistent data is stored securely on local storage or server-side JSON files. - API endpoints (`/api/registerUser`, `/api/visitorCount`) include basic validation to ensure data integrity and minimize malicious usage. --- ## **Extensibility & Future Considerations** - The modular architecture facilitates easy integration of additional AI models or APIs. - Potential expansions might include enhanced security measures, comprehensive backend database integration, more complex personalization features, or further multimedia interactions. --- This detailed breakdown encapsulates your application's extensive functionality, highlighting a robust and user-centric design that seamlessly integrates advanced AI interactions with user experience enhancements, comprehensive storage, personalization, multimedia features, and robust backend capabilities.
About
No description, website, or topics provided.
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published