├── Server ├── Requirements.txt ├── package.json ├── Utilities │ ├── Algorithms.js │ ├── BootHelper.js │ └── Runtime.js ├── Routes │ └── Chat.js ├── .env ├── Controllers │ ├── Error.js │ └── Chat.js ├── Tools │ └── GPT │ │ ├── index.js │ │ └── GPTHandler.py └── Server.js ├── Documentation ├── static │ ├── .nojekyll │ ├── img │ │ ├── logo.png │ │ ├── favicon.ico │ │ ├── WebApp-Landing.png │ │ ├── WebApp-Historial.png │ │ ├── WebApp-MobileOne.png │ │ ├── WebApp-MobileTwo.png │ │ ├── WebApp-Presentation.png │ │ └── WebApp-Settings-Menu.png │ └── videos │ │ ├── WebApp-Usage.mp4 │ │ └── WebApp-Mobile-Usage.mp4 ├── babel.config.js ├── src │ ├── pages │ │ └── markdown-page.md │ ├── components │ │ └── HomepageFeatures │ │ │ ├── styles.module.css │ │ │ └── index.js │ └── css │ │ └── custom.css ├── .gitignore ├── docs │ ├── Web-App-Usage.mdx │ ├── Mounting-Server.md │ ├── Installation.md │ ├── Using-The-API.md │ ├── Mounting-Client.md │ ├── Available-Providers.md │ └── Using-The-WS.md ├── sidebars.js ├── README.md ├── package.json └── docusaurus.config.js ├── Client ├── public │ ├── robots.txt │ ├── Images │ │ ├── Favicon.ico │ │ └── Apple │ │ │ ├── 57x57.png │ │ │ ├── 72x72.png │ │ │ ├── 76x76.png │ │ │ ├── 114x114.png │ │ │ ├── 120x120.png │ │ │ ├── 144x144.png │ │ │ ├── 152x152.png │ │ │ └── 180x180.png │ └── Manifest.json ├── .eslintrc.cjs ├── src │ ├── Pages │ │ ├── Everybody │ │ │ ├── Home │ │ │ │ ├── index.js │ │ │ │ ├── Home.jsx │ │ │ │ └── Home.css │ │ │ ├── About │ │ │ │ ├── index.js │ │ │ │ ├── About.css │ │ │ │ └── About.jsx │ │ │ ├── HTTP404 │ │ │ │ ├── index.js │ │ │ │ └── HTTP404.jsx │ │ │ └── index.js │ │ └── index.js │ ├── Components │ │ ├── Chat │ │ │ ├── SideMenu │ │ │ │ ├── index.js │ │ │ │ ├── SideMenu.css │ │ │ │ └── SideMenu.jsx │ │ │ ├── ChatViewer │ │ │ │ ├── index.js │ │ │ │ └── ChatViewer.css │ │ │ ├── SettingsMenu │ │ │ │ ├── index.js │ │ │ │ ├── SettingsMenu.css │ │ │ │ └── SettingsMenu.jsx │ │ │ ├── MobileOptions │ │ │ │ ├── index.js │ │ │ │ ├── MobileOptions.css │ │ │ │ └── MobileOptions.jsx │ │ │ ├── RenderResponse │ │ │ │ ├── index.js │ │ │ │ ├── RenderResponse.css │ │ │ │ └── RenderResponse.jsx │ │ │ ├── WaitingResponse │ │ │ │ ├── index.js │ │ │ │ ├── WaitingResponse.jsx │ │ │ │ └── WaitingResponse.css │ │ │ ├── MobileActivityMenu │ │ │ │ ├── index.js │ │ │ │ ├── MobileActivityMenu.css │ │ │ │ └── MobileActivityMenu.jsx │ │ │ └── StoredChatResponsesViewer │ │ │ │ ├── index.js │ │ │ │ ├── StoredChatResponsesViewer.css │ │ │ │ └── StoredChatResponsesViewer.jsx │ │ └── General │ │ │ ├── MenuIcon │ │ │ ├── index.js │ │ │ ├── MenuIcon.jsx │ │ │ └── MenuIcon.css │ │ │ ├── LanguageSelect │ │ │ ├── index.js │ │ │ ├── LanguageSelect.css │ │ │ └── LanguageSelect.jsx │ │ │ ├── ScrollProgress │ │ │ ├── index.js │ │ │ ├── ScrollProgress.css │ │ │ └── ScrollProgress.jsx │ │ │ ├── LovelaceAnimation │ │ │ ├── index.js │ │ │ └── LovelaceAnimation.css │ │ │ ├── ScrollToTop.jsx │ │ │ ├── Select.jsx │ │ │ ├── Popover.jsx │ │ │ └── Layout │ │ │ └── Layout.css │ ├── Locale │ │ ├── index.js │ │ └── CH.json │ ├── Services │ │ └── Core │ │ │ ├── Service.js │ │ │ └── Context.jsx │ ├── Hooks │ │ └── UseWindowSize.js │ ├── Application.jsx │ ├── Utilities │ │ ├── Algorithms.js │ │ └── Runtime.js │ ├── index.jsx │ └── Assets │ │ └── StyleSheets │ │ └── General.css ├── vite.config.js ├── .env ├── package.json └── index.html ├── .clocignore └── LICENSE.md /Server/Requirements.txt: -------------------------------------------------------------------------------- 1 | g4f -------------------------------------------------------------------------------- /Documentation/static/.nojekyll: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Client/public/robots.txt: -------------------------------------------------------------------------------- 1 | # https://www.robotstxt.org/robotstxt.html 2 | User-agent: * 3 | Disallow: -------------------------------------------------------------------------------- /Client/public/Images/Favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodyherrera/Lovelace/HEAD/Client/public/Images/Favicon.ico -------------------------------------------------------------------------------- /Documentation/static/img/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodyherrera/Lovelace/HEAD/Documentation/static/img/logo.png -------------------------------------------------------------------------------- /Client/public/Images/Apple/57x57.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodyherrera/Lovelace/HEAD/Client/public/Images/Apple/57x57.png -------------------------------------------------------------------------------- /Client/public/Images/Apple/72x72.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodyherrera/Lovelace/HEAD/Client/public/Images/Apple/72x72.png -------------------------------------------------------------------------------- /Client/public/Images/Apple/76x76.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodyherrera/Lovelace/HEAD/Client/public/Images/Apple/76x76.png -------------------------------------------------------------------------------- /Documentation/static/img/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodyherrera/Lovelace/HEAD/Documentation/static/img/favicon.ico -------------------------------------------------------------------------------- /Client/public/Images/Apple/114x114.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodyherrera/Lovelace/HEAD/Client/public/Images/Apple/114x114.png -------------------------------------------------------------------------------- /Client/public/Images/Apple/120x120.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodyherrera/Lovelace/HEAD/Client/public/Images/Apple/120x120.png -------------------------------------------------------------------------------- /Client/public/Images/Apple/144x144.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodyherrera/Lovelace/HEAD/Client/public/Images/Apple/144x144.png -------------------------------------------------------------------------------- /Client/public/Images/Apple/152x152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodyherrera/Lovelace/HEAD/Client/public/Images/Apple/152x152.png -------------------------------------------------------------------------------- /Client/public/Images/Apple/180x180.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodyherrera/Lovelace/HEAD/Client/public/Images/Apple/180x180.png -------------------------------------------------------------------------------- /Documentation/babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [require.resolve('@docusaurus/core/lib/babel/preset')], 3 | }; 4 | -------------------------------------------------------------------------------- /Documentation/static/img/WebApp-Landing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodyherrera/Lovelace/HEAD/Documentation/static/img/WebApp-Landing.png -------------------------------------------------------------------------------- /Documentation/static/img/WebApp-Historial.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodyherrera/Lovelace/HEAD/Documentation/static/img/WebApp-Historial.png -------------------------------------------------------------------------------- /Documentation/static/img/WebApp-MobileOne.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodyherrera/Lovelace/HEAD/Documentation/static/img/WebApp-MobileOne.png -------------------------------------------------------------------------------- /Documentation/static/img/WebApp-MobileTwo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodyherrera/Lovelace/HEAD/Documentation/static/img/WebApp-MobileTwo.png -------------------------------------------------------------------------------- /Documentation/static/videos/WebApp-Usage.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodyherrera/Lovelace/HEAD/Documentation/static/videos/WebApp-Usage.mp4 -------------------------------------------------------------------------------- /Documentation/static/img/WebApp-Presentation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodyherrera/Lovelace/HEAD/Documentation/static/img/WebApp-Presentation.png -------------------------------------------------------------------------------- /Documentation/static/img/WebApp-Settings-Menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodyherrera/Lovelace/HEAD/Documentation/static/img/WebApp-Settings-Menu.png -------------------------------------------------------------------------------- /Documentation/static/videos/WebApp-Mobile-Usage.mp4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rodyherrera/Lovelace/HEAD/Documentation/static/videos/WebApp-Mobile-Usage.mp4 -------------------------------------------------------------------------------- /Documentation/src/pages/markdown-page.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Markdown page example 3 | --- 4 | 5 | # Markdown page example 6 | 7 | You don't need React to write simple standalone pages. 8 | -------------------------------------------------------------------------------- /Documentation/src/components/HomepageFeatures/styles.module.css: -------------------------------------------------------------------------------- 1 | .features { 2 | display: flex; 3 | align-items: center; 4 | padding: 2rem 0; 5 | width: 100%; 6 | } 7 | 8 | .featureSvg { 9 | height: 200px; 10 | width: 200px; 11 | } 12 | -------------------------------------------------------------------------------- /.clocignore: -------------------------------------------------------------------------------- 1 | Client/node_modules 2 | Client/package-lock.json 3 | Client/package.json 4 | Client/.eslintrc.cjs 5 | Client/.gitignore 6 | Client/vite.config.js 7 | 8 | Server/Tools/GPT/g4f 9 | Server/node_modules 10 | Server/package-lock.json 11 | Server/package.json 12 | 13 | Documentation/ -------------------------------------------------------------------------------- /Documentation/.gitignore: -------------------------------------------------------------------------------- 1 | # Dependencies 2 | /node_modules 3 | 4 | # Production 5 | /build 6 | 7 | # Generated files 8 | .docusaurus 9 | .cache-loader 10 | 11 | # Misc 12 | .DS_Store 13 | .env.local 14 | .env.development.local 15 | .env.test.local 16 | .env.production.local 17 | 18 | npm-debug.log* 19 | yarn-debug.log* 20 | yarn-error.log* 21 | -------------------------------------------------------------------------------- /Client/.eslintrc.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | env: { browser: true, es2020: true }, 3 | extends: [ 4 | 'eslint:recommended', 5 | 'plugin:react/recommended', 6 | 'plugin:react/jsx-runtime', 7 | 'plugin:react-hooks/recommended', 8 | ], 9 | parserOptions: { ecmaVersion: 'latest', sourceType: 'module' }, 10 | settings: { react: { version: '18.2' } }, 11 | plugins: ['react-refresh'], 12 | rules: { 13 | 'react-refresh/only-export-components': 'warn', 14 | }, 15 | } 16 | -------------------------------------------------------------------------------- /Client/public/Manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "dir": "auto", 3 | "short_name": "Lovelace", 4 | "name": "Lovelace - Decentralizing The AI ​​Industry", 5 | "lang": "en-US", 6 | "description": "Use ChatGPT completely free and anonymously, what are you waiting for to be able to chat with the most philosophical conversations and questions about your existence?", 7 | "start_url": ".", 8 | "display": "standalone", 9 | "theme_color": "#000000", 10 | "background_color": "#000000", 11 | "related_applications": [ 12 | { 13 | "platform": "web" 14 | } 15 | ], 16 | "icons": [ 17 | ] 18 | } -------------------------------------------------------------------------------- /Documentation/docs/Web-App-Usage.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 9 3 | hide_table_of_contents: true 4 | --- 5 | 6 | import ReactPlayer from 'react-player'; 7 | 8 | # Exemplifying the use of the web application on computers and mobiles. 9 | 10 | ## Using the web application on Desktop 11 | In the video that will be presented below, you will be able to see the different animations and options that Lovelace provides in its web application. 12 | 13 | 14 | ## Using the web application on mobile 15 | In the following video, you can also see how multiple requests are made at the same time to resolve a request, animations among other things.... 16 | 17 | 18 | -------------------------------------------------------------------------------- /Server/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "lovelace-server", 3 | "private": false, 4 | "version": "1.0.1", 5 | "author": { 6 | "name": "CodeWithRodi", 7 | "email": "contact@codewithrodi.com", 8 | "url": "https://www.codewithrodi.com/" 9 | }, 10 | "repository": { 11 | "url": "https://github.com/CodeWithRodi/Lovelace/" 12 | }, 13 | "scripts": { 14 | "start": "node Server", 15 | "dev": "nodemon Server" 16 | }, 17 | "dependencies": { 18 | "compression": "^1.7.4", 19 | "cors": "^2.8.5", 20 | "dotenv": "^16.3.1", 21 | "express": "^4.18.2", 22 | "helmet": "^7.0.0", 23 | "hpp": "^0.2.3", 24 | "nodemon": "^3.0.1", 25 | "python-shell": "^5.0.0", 26 | "socket.io": "^4.7.1", 27 | "xss": "^1.0.14", 28 | "xss-clean": "^0.1.4" 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /Documentation/sidebars.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Creating a sidebar enables you to: 3 | - create an ordered group of docs 4 | - render a sidebar for each doc of that group 5 | - provide next/previous navigation 6 | 7 | The sidebars can be generated from the filesystem, or explicitly defined here. 8 | 9 | Create as many sidebars as you want. 10 | */ 11 | 12 | // @ts-check 13 | 14 | /** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */ 15 | const sidebars = { 16 | // By default, Docusaurus generates a sidebar from the docs folder structure 17 | tutorialSidebar: [{type: 'autogenerated', dirName: '.'}], 18 | 19 | // But you can create a sidebar manually 20 | /* 21 | tutorialSidebar: [ 22 | 'intro', 23 | 'hello', 24 | { 25 | type: 'category', 26 | label: 'Tutorial', 27 | items: ['tutorial-basics/create-a-document'], 28 | }, 29 | ], 30 | */ 31 | }; 32 | 33 | module.exports = sidebars; 34 | -------------------------------------------------------------------------------- /Documentation/README.md: -------------------------------------------------------------------------------- 1 | # Website 2 | 3 | This website is built using [Docusaurus 2](https://docusaurus.io/), a modern static website generator. 4 | 5 | ### Installation 6 | 7 | ``` 8 | $ yarn 9 | ``` 10 | 11 | ### Local Development 12 | 13 | ``` 14 | $ yarn start 15 | ``` 16 | 17 | This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server. 18 | 19 | ### Build 20 | 21 | ``` 22 | $ yarn build 23 | ``` 24 | 25 | This command generates static content into the `build` directory and can be served using any static contents hosting service. 26 | 27 | ### Deployment 28 | 29 | Using SSH: 30 | 31 | ``` 32 | $ USE_SSH=true yarn deploy 33 | ``` 34 | 35 | Not using SSH: 36 | 37 | ``` 38 | $ GIT_USER= yarn deploy 39 | ``` 40 | 41 | If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch. 42 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Rodolfo Herrera Hernandez 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /Documentation/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "documentation", 3 | "version": "0.0.0", 4 | "private": true, 5 | "scripts": { 6 | "docusaurus": "docusaurus", 7 | "start": "docusaurus start", 8 | "build": "docusaurus build", 9 | "swizzle": "docusaurus swizzle", 10 | "deploy": "docusaurus deploy", 11 | "clear": "docusaurus clear", 12 | "serve": "docusaurus serve", 13 | "write-translations": "docusaurus write-translations", 14 | "write-heading-ids": "docusaurus write-heading-ids" 15 | }, 16 | "dependencies": { 17 | "@docusaurus/core": "2.4.1", 18 | "@docusaurus/preset-classic": "2.4.1", 19 | "@mdx-js/react": "^1.6.22", 20 | "clsx": "^1.2.1", 21 | "prism-react-renderer": "^1.3.5", 22 | "react": "^17.0.2", 23 | "react-dom": "^17.0.2", 24 | "react-player": "^2.12.0" 25 | }, 26 | "devDependencies": { 27 | "@docusaurus/module-type-aliases": "2.4.1" 28 | }, 29 | "browserslist": { 30 | "production": [ 31 | ">0.5%", 32 | "not dead", 33 | "not op_mini all" 34 | ], 35 | "development": [ 36 | "last 1 chrome version", 37 | "last 1 firefox version", 38 | "last 1 safari version" 39 | ] 40 | }, 41 | "engines": { 42 | "node": ">=16.14" 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Client/src/Pages/Everybody/Home/index.js: -------------------------------------------------------------------------------- 1 | /*** 2 | * Copyright (C) Rodolfo Herrera Hernandez. All rights reserved. 3 | * Licensed under the MIT license. See LICENSE file in the project root 4 | * for full license information. 5 | * 6 | * =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 7 | * 8 | * In the vast universe of knowledge, the Open Source philosophy 9 | * shines like a radiant star. In this vein, Lovelace emerges 10 | * as an autonomous alternative to ChatGPT, based on 11 | * open source and self-hosting capabilities. 12 | * 13 | * Written in JavaScript, interacting with the library written 14 | * in Python, allows communication with ChatGPT through the use 15 | * of different services that facilitate its use by the public. 16 | * 17 | * For related information - https://github.com/CodeWithRodi/Lovelace/ 18 | * See also - https://github.com/xtekky/gpt4free 19 | * 20 | * :: https://lovelace.codewithrodi.com/ 21 | * :: https://lovelace-backend.codewithrodi.com/ 22 | * :: https://lovelace-docs.codewithrodi.com/ 23 | * 24 | * =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 25 | ****/ 26 | 27 | import Home from './Home'; 28 | 29 | export default Home; -------------------------------------------------------------------------------- /Client/src/Pages/Everybody/About/index.js: -------------------------------------------------------------------------------- 1 | /*** 2 | * Copyright (C) Rodolfo Herrera Hernandez. All rights reserved. 3 | * Licensed under the MIT license. See LICENSE file in the project root 4 | * for full license information. 5 | * 6 | * =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 7 | * 8 | * In the vast universe of knowledge, the Open Source philosophy 9 | * shines like a radiant star. In this vein, Lovelace emerges 10 | * as an autonomous alternative to ChatGPT, based on 11 | * open source and self-hosting capabilities. 12 | * 13 | * Written in JavaScript, interacting with the library written 14 | * in Python, allows communication with ChatGPT through the use 15 | * of different services that facilitate its use by the public. 16 | * 17 | * For related information - https://github.com/CodeWithRodi/Lovelace/ 18 | * See also - https://github.com/xtekky/gpt4free 19 | * 20 | * :: https://lovelace.codewithrodi.com/ 21 | * :: https://lovelace-backend.codewithrodi.com/ 22 | * :: https://lovelace-docs.codewithrodi.com/ 23 | * 24 | * =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 25 | ****/ 26 | 27 | import About from './About'; 28 | 29 | export default About; -------------------------------------------------------------------------------- /Client/src/Pages/Everybody/HTTP404/index.js: -------------------------------------------------------------------------------- 1 | /*** 2 | * Copyright (C) Rodolfo Herrera Hernandez. All rights reserved. 3 | * Licensed under the MIT license. See LICENSE file in the project root 4 | * for full license information. 5 | * 6 | * =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 7 | * 8 | * In the vast universe of knowledge, the Open Source philosophy 9 | * shines like a radiant star. In this vein, Lovelace emerges 10 | * as an autonomous alternative to ChatGPT, based on 11 | * open source and self-hosting capabilities. 12 | * 13 | * Written in JavaScript, interacting with the library written 14 | * in Python, allows communication with ChatGPT through the use 15 | * of different services that facilitate its use by the public. 16 | * 17 | * For related information - https://github.com/CodeWithRodi/Lovelace/ 18 | * See also - https://github.com/xtekky/gpt4free 19 | * 20 | * :: https://lovelace.codewithrodi.com/ 21 | * :: https://lovelace-backend.codewithrodi.com/ 22 | * :: https://lovelace-docs.codewithrodi.com/ 23 | * 24 | * =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 25 | ****/ 26 | 27 | import HTTP404 from './HTTP404'; 28 | 29 | export default HTTP404; -------------------------------------------------------------------------------- /Client/src/Components/Chat/SideMenu/index.js: -------------------------------------------------------------------------------- 1 | /*** 2 | * Copyright (C) Rodolfo Herrera Hernandez. All rights reserved. 3 | * Licensed under the MIT license. See LICENSE file in the project root 4 | * for full license information. 5 | * 6 | * =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 7 | * 8 | * In the vast universe of knowledge, the Open Source philosophy 9 | * shines like a radiant star. In this vein, Lovelace emerges 10 | * as an autonomous alternative to ChatGPT, based on 11 | * open source and self-hosting capabilities. 12 | * 13 | * Written in JavaScript, interacting with the library written 14 | * in Python, allows communication with ChatGPT through the use 15 | * of different services that facilitate its use by the public. 16 | * 17 | * For related information - https://github.com/CodeWithRodi/Lovelace/ 18 | * See also - https://github.com/xtekky/gpt4free 19 | * 20 | * :: https://lovelace.codewithrodi.com/ 21 | * :: https://lovelace-backend.codewithrodi.com/ 22 | * :: https://lovelace-docs.codewithrodi.com/ 23 | * 24 | * =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 25 | ****/ 26 | 27 | import SideMenu from './SideMenu'; 28 | 29 | export default SideMenu; -------------------------------------------------------------------------------- /Client/src/Components/General/MenuIcon/index.js: -------------------------------------------------------------------------------- 1 | /*** 2 | * Copyright (C) Rodolfo Herrera Hernandez. All rights reserved. 3 | * Licensed under the MIT license. See LICENSE file in the project root 4 | * for full license information. 5 | * 6 | * =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 7 | * 8 | * In the vast universe of knowledge, the Open Source philosophy 9 | * shines like a radiant star. In this vein, Lovelace emerges 10 | * as an autonomous alternative to ChatGPT, based on 11 | * open source and self-hosting capabilities. 12 | * 13 | * Written in JavaScript, interacting with the library written 14 | * in Python, allows communication with ChatGPT through the use 15 | * of different services that facilitate its use by the public. 16 | * 17 | * For related information - https://github.com/CodeWithRodi/Lovelace/ 18 | * See also - https://github.com/xtekky/gpt4free 19 | * 20 | * :: https://lovelace.codewithrodi.com/ 21 | * :: https://lovelace-backend.codewithrodi.com/ 22 | * :: https://lovelace-docs.codewithrodi.com/ 23 | * 24 | * =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 25 | ****/ 26 | 27 | import MenuIcon from './MenuIcon'; 28 | 29 | export default MenuIcon; -------------------------------------------------------------------------------- /Documentation/src/css/custom.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Any CSS included here will be global. The classic template 3 | * bundles Infima by default. Infima is a CSS framework designed to 4 | * work well for content-centric websites. 5 | */ 6 | 7 | /* You can override the default Infima variables here. */ 8 | :root { 9 | --ifm-color-primary: #2e8555; 10 | --ifm-color-primary-dark: #29784c; 11 | --ifm-color-primary-darker: #277148; 12 | --ifm-color-primary-darkest: #205d3b; 13 | --ifm-color-primary-light: #33925d; 14 | --ifm-color-primary-lighter: #359962; 15 | --ifm-color-primary-lightest: #3cad6e; 16 | --ifm-code-font-size: 95%; 17 | --docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.1); 18 | --ifm-container-width-xl: 1000px 19 | } 20 | 21 | /* For readability concerns, you should choose a lighter palette in dark mode. */ 22 | [data-theme='dark'] { 23 | --ifm-color-primary: #25c2a0; 24 | --ifm-color-primary-dark: #21af90; 25 | --ifm-color-primary-darker: #1fa588; 26 | --ifm-color-primary-darkest: #1a8870; 27 | --ifm-color-primary-light: #29d5b0; 28 | --ifm-color-primary-lighter: #32d8b4; 29 | --ifm-color-primary-lightest: #4fddbf; 30 | --docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.3); 31 | } 32 | 33 | img{ 34 | margin: 0 auto; 35 | border-radius: .5rem; 36 | } 37 | -------------------------------------------------------------------------------- /Client/src/Components/Chat/ChatViewer/index.js: -------------------------------------------------------------------------------- 1 | /*** 2 | * Copyright (C) Rodolfo Herrera Hernandez. All rights reserved. 3 | * Licensed under the MIT license. See LICENSE file in the project root 4 | * for full license information. 5 | * 6 | * =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 7 | * 8 | * In the vast universe of knowledge, the Open Source philosophy 9 | * shines like a radiant star. In this vein, Lovelace emerges 10 | * as an autonomous alternative to ChatGPT, based on 11 | * open source and self-hosting capabilities. 12 | * 13 | * Written in JavaScript, interacting with the library written 14 | * in Python, allows communication with ChatGPT through the use 15 | * of different services that facilitate its use by the public. 16 | * 17 | * For related information - https://github.com/CodeWithRodi/Lovelace/ 18 | * See also - https://github.com/xtekky/gpt4free 19 | * 20 | * :: https://lovelace.codewithrodi.com/ 21 | * :: https://lovelace-backend.codewithrodi.com/ 22 | * :: https://lovelace-docs.codewithrodi.com/ 23 | * 24 | * =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 25 | ****/ 26 | 27 | import ChatViewer from './ChatViewer'; 28 | 29 | export default ChatViewer; -------------------------------------------------------------------------------- /Client/src/Components/Chat/SettingsMenu/index.js: -------------------------------------------------------------------------------- 1 | /*** 2 | * Copyright (C) Rodolfo Herrera Hernandez. All rights reserved. 3 | * Licensed under the MIT license. See LICENSE file in the project root 4 | * for full license information. 5 | * 6 | * =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 7 | * 8 | * In the vast universe of knowledge, the Open Source philosophy 9 | * shines like a radiant star. In this vein, Lovelace emerges 10 | * as an autonomous alternative to ChatGPT, based on 11 | * open source and self-hosting capabilities. 12 | * 13 | * Written in JavaScript, interacting with the library written 14 | * in Python, allows communication with ChatGPT through the use 15 | * of different services that facilitate its use by the public. 16 | * 17 | * For related information - https://github.com/CodeWithRodi/Lovelace/ 18 | * See also - https://github.com/xtekky/gpt4free 19 | * 20 | * :: https://lovelace.codewithrodi.com/ 21 | * :: https://lovelace-backend.codewithrodi.com/ 22 | * :: https://lovelace-docs.codewithrodi.com/ 23 | * 24 | * =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 25 | ****/ 26 | 27 | import SettingsMenu from './SettingsMenu'; 28 | 29 | export default SettingsMenu; -------------------------------------------------------------------------------- /Client/src/Components/Chat/MobileOptions/index.js: -------------------------------------------------------------------------------- 1 | /*** 2 | * Copyright (C) Rodolfo Herrera Hernandez. All rights reserved. 3 | * Licensed under the MIT license. See LICENSE file in the project root 4 | * for full license information. 5 | * 6 | * =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 7 | * 8 | * In the vast universe of knowledge, the Open Source philosophy 9 | * shines like a radiant star. In this vein, Lovelace emerges 10 | * as an autonomous alternative to ChatGPT, based on 11 | * open source and self-hosting capabilities. 12 | * 13 | * Written in JavaScript, interacting with the library written 14 | * in Python, allows communication with ChatGPT through the use 15 | * of different services that facilitate its use by the public. 16 | * 17 | * For related information - https://github.com/CodeWithRodi/Lovelace/ 18 | * See also - https://github.com/xtekky/gpt4free 19 | * 20 | * :: https://lovelace.codewithrodi.com/ 21 | * :: https://lovelace-backend.codewithrodi.com/ 22 | * :: https://lovelace-docs.codewithrodi.com/ 23 | * 24 | * =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 25 | ****/ 26 | 27 | import MobileOptions from './MobileOptions'; 28 | 29 | export default MobileOptions; -------------------------------------------------------------------------------- /Client/src/Components/Chat/RenderResponse/index.js: -------------------------------------------------------------------------------- 1 | /*** 2 | * Copyright (C) Rodolfo Herrera Hernandez. All rights reserved. 3 | * Licensed under the MIT license. See LICENSE file in the project root 4 | * for full license information. 5 | * 6 | * =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 7 | * 8 | * In the vast universe of knowledge, the Open Source philosophy 9 | * shines like a radiant star. In this vein, Lovelace emerges 10 | * as an autonomous alternative to ChatGPT, based on 11 | * open source and self-hosting capabilities. 12 | * 13 | * Written in JavaScript, interacting with the library written 14 | * in Python, allows communication with ChatGPT through the use 15 | * of different services that facilitate its use by the public. 16 | * 17 | * For related information - https://github.com/CodeWithRodi/Lovelace/ 18 | * See also - https://github.com/xtekky/gpt4free 19 | * 20 | * :: https://lovelace.codewithrodi.com/ 21 | * :: https://lovelace-backend.codewithrodi.com/ 22 | * :: https://lovelace-docs.codewithrodi.com/ 23 | * 24 | * =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 25 | ****/ 26 | 27 | import RenderResponse from './RenderResponse'; 28 | 29 | export default RenderResponse; -------------------------------------------------------------------------------- /Client/src/Components/General/LanguageSelect/index.js: -------------------------------------------------------------------------------- 1 | /*** 2 | * Copyright (C) Rodolfo Herrera Hernandez. All rights reserved. 3 | * Licensed under the MIT license. See LICENSE file in the project root 4 | * for full license information. 5 | * 6 | * =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 7 | * 8 | * In the vast universe of knowledge, the Open Source philosophy 9 | * shines like a radiant star. In this vein, Lovelace emerges 10 | * as an autonomous alternative to ChatGPT, based on 11 | * open source and self-hosting capabilities. 12 | * 13 | * Written in JavaScript, interacting with the library written 14 | * in Python, allows communication with ChatGPT through the use 15 | * of different services that facilitate its use by the public. 16 | * 17 | * For related information - https://github.com/CodeWithRodi/Lovelace/ 18 | * See also - https://github.com/xtekky/gpt4free 19 | * 20 | * :: https://lovelace.codewithrodi.com/ 21 | * :: https://lovelace-backend.codewithrodi.com/ 22 | * :: https://lovelace-docs.codewithrodi.com/ 23 | * 24 | * =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 25 | ****/ 26 | 27 | import LanguageSelect from './LanguageSelect'; 28 | 29 | export default LanguageSelect; -------------------------------------------------------------------------------- /Client/src/Components/General/ScrollProgress/index.js: -------------------------------------------------------------------------------- 1 | /*** 2 | * Copyright (C) Rodolfo Herrera Hernandez. All rights reserved. 3 | * Licensed under the MIT license. See LICENSE file in the project root 4 | * for full license information. 5 | * 6 | * =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 7 | * 8 | * In the vast universe of knowledge, the Open Source philosophy 9 | * shines like a radiant star. In this vein, Lovelace emerges 10 | * as an autonomous alternative to ChatGPT, based on 11 | * open source and self-hosting capabilities. 12 | * 13 | * Written in JavaScript, interacting with the library written 14 | * in Python, allows communication with ChatGPT through the use 15 | * of different services that facilitate its use by the public. 16 | * 17 | * For related information - https://github.com/CodeWithRodi/Lovelace/ 18 | * See also - https://github.com/xtekky/gpt4free 19 | * 20 | * :: https://lovelace.codewithrodi.com/ 21 | * :: https://lovelace-backend.codewithrodi.com/ 22 | * :: https://lovelace-docs.codewithrodi.com/ 23 | * 24 | * =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 25 | ****/ 26 | 27 | import ScrollProgress from './ScrollProgress'; 28 | 29 | export default ScrollProgress; -------------------------------------------------------------------------------- /Client/src/Components/Chat/WaitingResponse/index.js: -------------------------------------------------------------------------------- 1 | /*** 2 | * Copyright (C) Rodolfo Herrera Hernandez. All rights reserved. 3 | * Licensed under the MIT license. See LICENSE file in the project root 4 | * for full license information. 5 | * 6 | * =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 7 | * 8 | * In the vast universe of knowledge, the Open Source philosophy 9 | * shines like a radiant star. In this vein, Lovelace emerges 10 | * as an autonomous alternative to ChatGPT, based on 11 | * open source and self-hosting capabilities. 12 | * 13 | * Written in JavaScript, interacting with the library written 14 | * in Python, allows communication with ChatGPT through the use 15 | * of different services that facilitate its use by the public. 16 | * 17 | * For related information - https://github.com/CodeWithRodi/Lovelace/ 18 | * See also - https://github.com/xtekky/gpt4free 19 | * 20 | * :: https://lovelace.codewithrodi.com/ 21 | * :: https://lovelace-backend.codewithrodi.com/ 22 | * :: https://lovelace-docs.codewithrodi.com/ 23 | * 24 | * =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 25 | ****/ 26 | 27 | import WaitingResponse from './WaitingResponse'; 28 | 29 | export default WaitingResponse; -------------------------------------------------------------------------------- /Client/src/Pages/index.js: -------------------------------------------------------------------------------- 1 | /*** 2 | * Copyright (C) Rodolfo Herrera Hernandez. All rights reserved. 3 | * Licensed under the MIT license. See LICENSE file in the project root 4 | * for full license information. 5 | * 6 | * =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 7 | * 8 | * In the vast universe of knowledge, the Open Source philosophy 9 | * shines like a radiant star. In this vein, Lovelace emerges 10 | * as an autonomous alternative to ChatGPT, based on 11 | * open source and self-hosting capabilities. 12 | * 13 | * Written in JavaScript, interacting with the library written 14 | * in Python, allows communication with ChatGPT through the use 15 | * of different services that facilitate its use by the public. 16 | * 17 | * For related information - https://github.com/CodeWithRodi/Lovelace/ 18 | * See also - https://github.com/xtekky/gpt4free 19 | * 20 | * :: https://lovelace.codewithrodi.com/ 21 | * :: https://lovelace-backend.codewithrodi.com/ 22 | * :: https://lovelace-docs.codewithrodi.com/ 23 | * 24 | * =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 25 | ****/ 26 | 27 | import Everybody from './Everybody'; 28 | 29 | const Pages = { 30 | Everybody 31 | }; 32 | 33 | export default Pages; -------------------------------------------------------------------------------- /Client/src/Components/Chat/MobileActivityMenu/index.js: -------------------------------------------------------------------------------- 1 | /*** 2 | * Copyright (C) Rodolfo Herrera Hernandez. All rights reserved. 3 | * Licensed under the MIT license. See LICENSE file in the project root 4 | * for full license information. 5 | * 6 | * =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 7 | * 8 | * In the vast universe of knowledge, the Open Source philosophy 9 | * shines like a radiant star. In this vein, Lovelace emerges 10 | * as an autonomous alternative to ChatGPT, based on 11 | * open source and self-hosting capabilities. 12 | * 13 | * Written in JavaScript, interacting with the library written 14 | * in Python, allows communication with ChatGPT through the use 15 | * of different services that facilitate its use by the public. 16 | * 17 | * For related information - https://github.com/CodeWithRodi/Lovelace/ 18 | * See also - https://github.com/xtekky/gpt4free 19 | * 20 | * :: https://lovelace.codewithrodi.com/ 21 | * :: https://lovelace-backend.codewithrodi.com/ 22 | * :: https://lovelace-docs.codewithrodi.com/ 23 | * 24 | * =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 25 | ****/ 26 | 27 | import MobileActivityMenu from './MobileActivityMenu'; 28 | 29 | export default MobileActivityMenu; -------------------------------------------------------------------------------- /Client/src/Components/General/LovelaceAnimation/index.js: -------------------------------------------------------------------------------- 1 | /*** 2 | * Copyright (C) Rodolfo Herrera Hernandez. All rights reserved. 3 | * Licensed under the MIT license. See LICENSE file in the project root 4 | * for full license information. 5 | * 6 | * =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 7 | * 8 | * In the vast universe of knowledge, the Open Source philosophy 9 | * shines like a radiant star. In this vein, Lovelace emerges 10 | * as an autonomous alternative to ChatGPT, based on 11 | * open source and self-hosting capabilities. 12 | * 13 | * Written in JavaScript, interacting with the library written 14 | * in Python, allows communication with ChatGPT through the use 15 | * of different services that facilitate its use by the public. 16 | * 17 | * For related information - https://github.com/CodeWithRodi/Lovelace/ 18 | * See also - https://github.com/xtekky/gpt4free 19 | * 20 | * :: https://lovelace.codewithrodi.com/ 21 | * :: https://lovelace-backend.codewithrodi.com/ 22 | * :: https://lovelace-docs.codewithrodi.com/ 23 | * 24 | * =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 25 | ****/ 26 | 27 | import LovelaceAnimation from './LovelaceAnimation'; 28 | 29 | export default LovelaceAnimation; -------------------------------------------------------------------------------- /Client/src/Components/Chat/StoredChatResponsesViewer/index.js: -------------------------------------------------------------------------------- 1 | /*** 2 | * Copyright (C) Rodolfo Herrera Hernandez. All rights reserved. 3 | * Licensed under the MIT license. See LICENSE file in the project root 4 | * for full license information. 5 | * 6 | * =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 7 | * 8 | * In the vast universe of knowledge, the Open Source philosophy 9 | * shines like a radiant star. In this vein, Lovelace emerges 10 | * as an autonomous alternative to ChatGPT, based on 11 | * open source and self-hosting capabilities. 12 | * 13 | * Written in JavaScript, interacting with the library written 14 | * in Python, allows communication with ChatGPT through the use 15 | * of different services that facilitate its use by the public. 16 | * 17 | * For related information - https://github.com/CodeWithRodi/Lovelace/ 18 | * See also - https://github.com/xtekky/gpt4free 19 | * 20 | * :: https://lovelace.codewithrodi.com/ 21 | * :: https://lovelace-backend.codewithrodi.com/ 22 | * :: https://lovelace-docs.codewithrodi.com/ 23 | * 24 | * =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 25 | ****/ 26 | 27 | import StoredChatResponsesViewer from './StoredChatResponsesViewer'; 28 | 29 | export default StoredChatResponsesViewer; -------------------------------------------------------------------------------- /Server/Utilities/Algorithms.js: -------------------------------------------------------------------------------- 1 | /*** 2 | * Copyright (C) Rodolfo Herrera Hernandez. All rights reserved. 3 | * Licensed under the MIT license. See LICENSE file in the project root 4 | * for full license information. 5 | * 6 | * =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 7 | * 8 | * In the vast universe of knowledge, the Open Source philosophy 9 | * shines like a radiant star. In this vein, Lovelace emerges 10 | * as an autonomous alternative to ChatGPT, based on 11 | * open source and self-hosting capabilities. 12 | * 13 | * Written in JavaScript, interacting with the library written 14 | * in Python, allows communication with ChatGPT through the use 15 | * of different services that facilitate its use by the public. 16 | * 17 | * For related information - https://github.com/CodeWithRodi/Lovelace/ 18 | * See also - https://github.com/xtekky/gpt4free 19 | * 20 | * :: https://lovelace.codewithrodi.com/ 21 | * :: https://lovelace-backend.codewithrodi.com/ 22 | * :: https://lovelace-docs.codewithrodi.com/ 23 | * 24 | * =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 25 | ****/ 26 | 27 | exports.CapitalizeToLowerCaseWithDelimitier = (Value) => (Value.split('').map((Character, Index) => 28 | ((Character.match(/[A-Z]/) && Index !== 0) ? ('-') : ('')) + Character ) 29 | ).join('').toLowerCase(); -------------------------------------------------------------------------------- /Client/src/Pages/Everybody/index.js: -------------------------------------------------------------------------------- 1 | /*** 2 | * Copyright (C) Rodolfo Herrera Hernandez. All rights reserved. 3 | * Licensed under the MIT license. See LICENSE file in the project root 4 | * for full license information. 5 | * 6 | * =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 7 | * 8 | * In the vast universe of knowledge, the Open Source philosophy 9 | * shines like a radiant star. In this vein, Lovelace emerges 10 | * as an autonomous alternative to ChatGPT, based on 11 | * open source and self-hosting capabilities. 12 | * 13 | * Written in JavaScript, interacting with the library written 14 | * in Python, allows communication with ChatGPT through the use 15 | * of different services that facilitate its use by the public. 16 | * 17 | * For related information - https://github.com/CodeWithRodi/Lovelace/ 18 | * See also - https://github.com/xtekky/gpt4free 19 | * 20 | * :: https://lovelace.codewithrodi.com/ 21 | * :: https://lovelace-backend.codewithrodi.com/ 22 | * :: https://lovelace-docs.codewithrodi.com/ 23 | * 24 | * =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 25 | ****/ 26 | 27 | import Home from './Home'; 28 | import About from './About'; 29 | import HTTP404 from './HTTP404'; 30 | 31 | const Pages = { 32 | Home, 33 | About, 34 | HTTP404 35 | }; 36 | 37 | export default Pages; -------------------------------------------------------------------------------- /Client/src/Pages/Everybody/HTTP404/HTTP404.jsx: -------------------------------------------------------------------------------- 1 | /*** 2 | * Copyright (C) Rodolfo Herrera Hernandez. All rights reserved. 3 | * Licensed under the MIT license. See LICENSE file in the project root 4 | * for full license information. 5 | * 6 | * =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 7 | * 8 | * In the vast universe of knowledge, the Open Source philosophy 9 | * shines like a radiant star. In this vein, Lovelace emerges 10 | * as an autonomous alternative to ChatGPT, based on 11 | * open source and self-hosting capabilities. 12 | * 13 | * Written in JavaScript, interacting with the library written 14 | * in Python, allows communication with ChatGPT through the use 15 | * of different services that facilitate its use by the public. 16 | * 17 | * For related information - https://github.com/CodeWithRodi/Lovelace/ 18 | * See also - https://github.com/xtekky/gpt4free 19 | * 20 | * :: https://lovelace.codewithrodi.com/ 21 | * :: https://lovelace-backend.codewithrodi.com/ 22 | * :: https://lovelace-docs.codewithrodi.com/ 23 | * 24 | * =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 25 | ****/ 26 | 27 | import React from 'react'; 28 | import { Navigate } from 'react-router-dom'; 29 | 30 | const HTTP404Page = () => { 31 | 32 | return ( 33 | 34 | ); 35 | }; 36 | 37 | export default HTTP404Page; -------------------------------------------------------------------------------- /Client/src/Components/General/ScrollProgress/ScrollProgress.css: -------------------------------------------------------------------------------- 1 | /*** 2 | * Copyright (C) Rodolfo Herrera Hernandez. All rights reserved. 3 | * Licensed under the MIT license. See LICENSE file in the project root 4 | * for full license information. 5 | * 6 | * =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 7 | * 8 | * In the vast universe of knowledge, the Open Source philosophy 9 | * shines like a radiant star. In this vein, Lovelace emerges 10 | * as an autonomous alternative to ChatGPT, based on 11 | * open source and self-hosting capabilities. 12 | * 13 | * Written in JavaScript, interacting with the library written 14 | * in Python, allows communication with ChatGPT through the use 15 | * of different services that facilitate its use by the public. 16 | * 17 | * For related information - https://github.com/CodeWithRodi/Lovelace/ 18 | * See also - https://github.com/xtekky/gpt4free 19 | * 20 | * :: https://lovelace.codewithrodi.com/ 21 | * :: https://lovelace-backend.codewithrodi.com/ 22 | * :: https://lovelace-docs.codewithrodi.com/ 23 | * 24 | * =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 25 | ****/ 26 | 27 | #Scroll-Progress-Box{ 28 | position: fixed; 29 | top: 0; 30 | left: 0; 31 | right: 0; 32 | height: 2px; 33 | z-index: 250; 34 | background-color: #FFFFFF; 35 | transform-origin: 0%; 36 | } -------------------------------------------------------------------------------- /Client/vite.config.js: -------------------------------------------------------------------------------- 1 | /*** 2 | * Copyright (C) Rodolfo Herrera Hernandez. All rights reserved. 3 | * Licensed under the MIT license. See LICENSE file in the project root 4 | * for full license information. 5 | * 6 | * =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 7 | * 8 | * In the vast universe of knowledge, the Open Source philosophy 9 | * shines like a radiant star. In this vein, Lovelace emerges 10 | * as an autonomous alternative to ChatGPT, based on 11 | * open source and self-hosting capabilities. 12 | * 13 | * Written in JavaScript, interacting with the library written 14 | * in Python, allows communication with ChatGPT through the use 15 | * of different services that facilitate its use by the public. 16 | * 17 | * For related information - https://github.com/CodeWithRodi/Lovelace/ 18 | * See also - https://github.com/xtekky/gpt4free 19 | * 20 | * :: https://lovelace.codewithrodi.com/ 21 | * :: https://lovelace-backend.codewithrodi.com/ 22 | * :: https://lovelace-docs.codewithrodi.com/ 23 | * 24 | * =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 25 | ****/ 26 | 27 | import { defineConfig } from 'vite' 28 | import react from '@vitejs/plugin-react-swc' 29 | 30 | export default defineConfig({ 31 | plugins: [react()], 32 | server: { 33 | host: '0.0.0.0', 34 | port: 5173 35 | }, 36 | define: { 37 | } 38 | }); 39 | -------------------------------------------------------------------------------- /Server/Routes/Chat.js: -------------------------------------------------------------------------------- 1 | /*** 2 | * Copyright (C) Rodolfo Herrera Hernandez. All rights reserved. 3 | * Licensed under the MIT license. See LICENSE file in the project root 4 | * for full license information. 5 | * 6 | * =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 7 | * 8 | * In the vast universe of knowledge, the Open Source philosophy 9 | * shines like a radiant star. In this vein, Lovelace emerges 10 | * as an autonomous alternative to ChatGPT, based on 11 | * open source and self-hosting capabilities. 12 | * 13 | * Written in JavaScript, interacting with the library written 14 | * in Python, allows communication with ChatGPT through the use 15 | * of different services that facilitate its use by the public. 16 | * 17 | * For related information - https://github.com/CodeWithRodi/Lovelace/ 18 | * See also - https://github.com/xtekky/gpt4free 19 | * 20 | * :: https://lovelace.codewithrodi.com/ 21 | * :: https://lovelace-backend.codewithrodi.com/ 22 | * :: https://lovelace-docs.codewithrodi.com/ 23 | * 24 | * =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 25 | ****/ 26 | 27 | const Express = require('express'); 28 | const Router = Express.Router(); 29 | const ChatController = require('../Controllers/Chat'); 30 | 31 | Router.post('/completions', ChatController.HandleCompletion); 32 | Router.get('/providers', ChatController.GetProviders); 33 | 34 | module.exports = Router; -------------------------------------------------------------------------------- /Client/.env: -------------------------------------------------------------------------------- 1 | # =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 2 | # Copyright (C) Rodolfo Herrera Hernandez. All rights reserved. 3 | # Licensed under the MIT license. See LICENSE file in the project root 4 | # for full license information. 5 | # 6 | # =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 7 | # 8 | # In the vast universe of knowledge, the Open Source philosophy 9 | # shines like a radiant star. In this vein, Lovelace emerges 10 | # as an autonomous alternative to ChatGPT, based on 11 | # open source and self-hosting capabilities. 12 | # 13 | # Written in JavaScript, interacting with the library written 14 | # in Python, allows communication with ChatGPT through the use 15 | # of different services that facilitate its use by the public. 16 | # 17 | # For related information - https://github.com/CodeWithRodi/Lovelace/ 18 | # See also - https://github.com/xtekky/gpt4free 19 | # 20 | # :: https://lovelace.codewithrodi.com/ 21 | # :: https://lovelace-backend.codewithrodi.com/ 22 | # :: https://lovelace-docs.codewithrodi.com/ 23 | # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 24 | 25 | VITE_SERVER = http://0.0.0.0:8000 26 | VITE_API_SUFFIX = /api/v1 27 | VITE_DONATE_LINK = https://ko-fi.com/codewithrodi 28 | VITE_GPT4FREE_LINK = https://github.com/xtekky/gpt4free 29 | VITE_SOFTWARE_REPOSITORY_LINK = https://github.com/codewithrodi/Lovelace 30 | -------------------------------------------------------------------------------- /Client/src/Components/General/ScrollToTop.jsx: -------------------------------------------------------------------------------- 1 | /*** 2 | * Copyright (C) Rodolfo Herrera Hernandez. All rights reserved. 3 | * Licensed under the MIT license. See LICENSE file in the project root 4 | * for full license information. 5 | * 6 | * =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 7 | * 8 | * In the vast universe of knowledge, the Open Source philosophy 9 | * shines like a radiant star. In this vein, Lovelace emerges 10 | * as an autonomous alternative to ChatGPT, based on 11 | * open source and self-hosting capabilities. 12 | * 13 | * Written in JavaScript, interacting with the library written 14 | * in Python, allows communication with ChatGPT through the use 15 | * of different services that facilitate its use by the public. 16 | * 17 | * For related information - https://github.com/CodeWithRodi/Lovelace/ 18 | * See also - https://github.com/xtekky/gpt4free 19 | * 20 | * :: https://lovelace.codewithrodi.com/ 21 | * :: https://lovelace-backend.codewithrodi.com/ 22 | * :: https://lovelace-docs.codewithrodi.com/ 23 | * 24 | * =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 25 | ****/ 26 | 27 | import { useEffect } from 'react'; 28 | import { useLocation } from 'react-router'; 29 | 30 | const ScrollToTop = (Properties) => { 31 | const Location = useLocation(); 32 | 33 | useEffect(() => { 34 | window.scrollTo(0, 0); 35 | }, [Location]); 36 | 37 | return Properties.children; 38 | }; 39 | 40 | export default ScrollToTop; -------------------------------------------------------------------------------- /Client/src/Components/Chat/WaitingResponse/WaitingResponse.jsx: -------------------------------------------------------------------------------- 1 | /*** 2 | * Copyright (C) Rodolfo Herrera Hernandez. All rights reserved. 3 | * Licensed under the MIT license. See LICENSE file in the project root 4 | * for full license information. 5 | * 6 | * =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 7 | * 8 | * In the vast universe of knowledge, the Open Source philosophy 9 | * shines like a radiant star. In this vein, Lovelace emerges 10 | * as an autonomous alternative to ChatGPT, based on 11 | * open source and self-hosting capabilities. 12 | * 13 | * Written in JavaScript, interacting with the library written 14 | * in Python, allows communication with ChatGPT through the use 15 | * of different services that facilitate its use by the public. 16 | * 17 | * For related information - https://github.com/CodeWithRodi/Lovelace/ 18 | * See also - https://github.com/xtekky/gpt4free 19 | * 20 | * :: https://lovelace.codewithrodi.com/ 21 | * :: https://lovelace-backend.codewithrodi.com/ 22 | * :: https://lovelace-docs.codewithrodi.com/ 23 | * 24 | * =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 25 | ****/ 26 | 27 | import React from 'react'; 28 | import './WaitingResponse.css'; 29 | 30 | const WaitingResponse = () => { 31 | 32 | return ( 33 |
34 | {[...Array(3).keys()].map((Value) => ( 35 | . 36 | ))} 37 |
38 | ); 39 | }; 40 | 41 | export default WaitingResponse; -------------------------------------------------------------------------------- /Client/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "lovelace-client", 3 | "private": false, 4 | "version": "1.0.1", 5 | "type": "module", 6 | "author": { 7 | "name": "CodeWithRodi", 8 | "email": "contact@codewithrodi.com", 9 | "url": "https://www.codewithrodi.com/" 10 | }, 11 | "repository": { 12 | "url": "https://github.com/CodeWithRodi/Lovelace/" 13 | }, 14 | "scripts": { 15 | "dev": "vite", 16 | "build": "vite build", 17 | "lint": "eslint src --ext js,jsx --report-unused-disable-directives --max-warnings 0", 18 | "preview": "vite preview" 19 | }, 20 | "dependencies": { 21 | "@emotion/react": "^11.11.1", 22 | "@emotion/styled": "^11.11.0", 23 | "@mui/material": "^5.13.5", 24 | "animejs": "^3.2.1", 25 | "axios": "^1.4.0", 26 | "evergreen-ui": "^7.1.8", 27 | "framer-motion": "^10.12.18", 28 | "hiding-header-react": "^0.6.6", 29 | "lorem-ipsum": "^2.0.8", 30 | "react": "^18.2.0", 31 | "react-code-blocks": "*", 32 | "react-dom": "^18.2.0", 33 | "react-icons": "^4.9.0", 34 | "react-pendulum": "^0.0.1", 35 | "react-reveal": "^1.2.2", 36 | "react-router-dom": "^6.12.1", 37 | "react-useanimations": "^2.10.0", 38 | "socket.io-client": "^4.7.1", 39 | "uuid": "^9.0.0" 40 | }, 41 | "devDependencies": { 42 | "@types/react": "^18.0.37", 43 | "@types/react-dom": "^18.0.11", 44 | "@vitejs/plugin-react-swc": "^3.0.0", 45 | "eslint": "^8.38.0", 46 | "eslint-plugin-react": "^7.32.2", 47 | "eslint-plugin-react-hooks": "^4.6.0", 48 | "eslint-plugin-react-refresh": "^0.3.4", 49 | "vite": "^4.3.9" 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /Client/src/Locale/index.js: -------------------------------------------------------------------------------- 1 | /*** 2 | * Copyright (C) Rodolfo Herrera Hernandez. All rights reserved. 3 | * Licensed under the MIT license. See LICENSE file in the project root 4 | * for full license information. 5 | * 6 | * =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 7 | * 8 | * In the vast universe of knowledge, the Open Source philosophy 9 | * shines like a radiant star. In this vein, Lovelace emerges 10 | * as an autonomous alternative to ChatGPT, based on 11 | * open source and self-hosting capabilities. 12 | * 13 | * Written in JavaScript, interacting with the library written 14 | * in Python, allows communication with ChatGPT through the use 15 | * of different services that facilitate its use by the public. 16 | * 17 | * For related information - https://github.com/CodeWithRodi/Lovelace/ 18 | * See also - https://github.com/xtekky/gpt4free 19 | * 20 | * :: https://lovelace.codewithrodi.com/ 21 | * :: https://lovelace-backend.codewithrodi.com/ 22 | * :: https://lovelace-docs.codewithrodi.com/ 23 | * 24 | * =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 25 | ****/ 26 | 27 | import EN from './EN.json'; 28 | import ES from './ES.json'; 29 | import DE from './DE.json'; 30 | import PR from './PR.json'; 31 | import TR from './TR.json'; 32 | import RU from './RU.json'; 33 | import CH from './CH.json'; 34 | import AR from './AR.json'; 35 | import FR from './FR.json'; 36 | import IT from './IT.json'; 37 | 38 | const Locales = { 39 | AR, 40 | CH, 41 | DE, 42 | EN, 43 | ES, 44 | FR, 45 | IT, 46 | PR, 47 | RU, 48 | TR 49 | }; 50 | 51 | export const GetAvailableLocales = Object.keys(Locales); 52 | 53 | export default Locales; -------------------------------------------------------------------------------- /Client/src/Components/General/ScrollProgress/ScrollProgress.jsx: -------------------------------------------------------------------------------- 1 | /*** 2 | * Copyright (C) Rodolfo Herrera Hernandez. All rights reserved. 3 | * Licensed under the MIT license. See LICENSE file in the project root 4 | * for full license information. 5 | * 6 | * =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 7 | * 8 | * In the vast universe of knowledge, the Open Source philosophy 9 | * shines like a radiant star. In this vein, Lovelace emerges 10 | * as an autonomous alternative to ChatGPT, based on 11 | * open source and self-hosting capabilities. 12 | * 13 | * Written in JavaScript, interacting with the library written 14 | * in Python, allows communication with ChatGPT through the use 15 | * of different services that facilitate its use by the public. 16 | * 17 | * For related information - https://github.com/CodeWithRodi/Lovelace/ 18 | * See also - https://github.com/xtekky/gpt4free 19 | * 20 | * :: https://lovelace.codewithrodi.com/ 21 | * :: https://lovelace-backend.codewithrodi.com/ 22 | * :: https://lovelace-docs.codewithrodi.com/ 23 | * 24 | * =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 25 | ****/ 26 | 27 | import React from 'react'; 28 | import { motion, useScroll, useSpring } from 'framer-motion'; 29 | import './ScrollProgress.css'; 30 | 31 | const ScrollProgress = ({ ContainerReference = null, ...Properties }) => { 32 | const { scrollYProgress } = useScroll({ ...(ContainerReference) && ({ container: ContainerReference }) }); 33 | const scaleX = useSpring(scrollYProgress); 34 | 35 | return ( 36 | 39 | ); 40 | }; 41 | 42 | export default ScrollProgress; -------------------------------------------------------------------------------- /Client/src/Components/Chat/WaitingResponse/WaitingResponse.css: -------------------------------------------------------------------------------- 1 | /*** 2 | * Copyright (C) Rodolfo Herrera Hernandez. All rights reserved. 3 | * Licensed under the MIT license. See LICENSE file in the project root 4 | * for full license information. 5 | * 6 | * =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 7 | * 8 | * In the vast universe of knowledge, the Open Source philosophy 9 | * shines like a radiant star. In this vein, Lovelace emerges 10 | * as an autonomous alternative to ChatGPT, based on 11 | * open source and self-hosting capabilities. 12 | * 13 | * Written in JavaScript, interacting with the library written 14 | * in Python, allows communication with ChatGPT through the use 15 | * of different services that facilitate its use by the public. 16 | * 17 | * For related information - https://github.com/CodeWithRodi/Lovelace/ 18 | * See also - https://github.com/xtekky/gpt4free 19 | * 20 | * :: https://lovelace.codewithrodi.com/ 21 | * :: https://lovelace-backend.codewithrodi.com/ 22 | * :: https://lovelace-docs.codewithrodi.com/ 23 | * 24 | * =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 25 | ****/ 26 | 27 | #Waiting-Response-Box{ 28 | font-weight: 800; 29 | perspective: 1000px; 30 | display: flex; 31 | align-items: center; 32 | } 33 | 34 | @keyframes WaitingResponseLoading{ 35 | 0%, 100% { 36 | transform: translateY(-10px); 37 | } 38 | 50% { 39 | transform: translateY(3px); 40 | } 41 | } 42 | 43 | #Waiting-Response-Box span{ 44 | animation: WaitingResponseLoading .7s infinite; 45 | display: inline-block; 46 | } 47 | 48 | #Waiting-Response-Box span:nth-child(2){ 49 | animation-delay: 0.1s; 50 | } 51 | 52 | #Waiting-Response-Box span:nth-child(3){ 53 | animation-delay: 0.2s; 54 | } -------------------------------------------------------------------------------- /Client/src/Services/Core/Service.js: -------------------------------------------------------------------------------- 1 | /*** 2 | * Copyright (C) Rodolfo Herrera Hernandez. All rights reserved. 3 | * Licensed under the MIT license. See LICENSE file in the project root 4 | * for full license information. 5 | * 6 | * =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 7 | * 8 | * In the vast universe of knowledge, the Open Source philosophy 9 | * shines like a radiant star. In this vein, Lovelace emerges 10 | * as an autonomous alternative to ChatGPT, based on 11 | * open source and self-hosting capabilities. 12 | * 13 | * Written in JavaScript, interacting with the library written 14 | * in Python, allows communication with ChatGPT through the use 15 | * of different services that facilitate its use by the public. 16 | * 17 | * For related information - https://github.com/CodeWithRodi/Lovelace/ 18 | * See also - https://github.com/xtekky/gpt4free 19 | * 20 | * :: https://lovelace.codewithrodi.com/ 21 | * :: https://lovelace-backend.codewithrodi.com/ 22 | * :: https://lovelace-docs.codewithrodi.com/ 23 | * 24 | * =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 25 | ****/ 26 | 27 | import Locales from '../../Locale'; 28 | import { QuickLocalStorageRescue } from '../../Utilities/Runtime'; 29 | 30 | export const LocalStorageIdentifier = { 31 | Settings: 'Lovelace::Service::Core::Settings' 32 | }; 33 | 34 | export const ClientLanguage = navigator.language.split('-')[0].toUpperCase(); 35 | export const GetLocalesFromLanguage = (Language) => (Locales?.[Language.toUpperCase()] || Locales['EN']); 36 | 37 | export const StoredLocalStorageSettings = () => QuickLocalStorageRescue(LocalStorageIdentifier.Settings); 38 | export const StoreLocalStorageSettings = (Settings) => localStorage.setItem(LocalStorageIdentifier.Settings, JSON.stringify(Settings)); -------------------------------------------------------------------------------- /Client/src/Hooks/UseWindowSize.js: -------------------------------------------------------------------------------- 1 | /*** 2 | * Copyright (C) Rodolfo Herrera Hernandez. All rights reserved. 3 | * Licensed under the MIT license. See LICENSE file in the project root 4 | * for full license information. 5 | * 6 | * =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 7 | * 8 | * In the vast universe of knowledge, the Open Source philosophy 9 | * shines like a radiant star. In this vein, Lovelace emerges 10 | * as an autonomous alternative to ChatGPT, based on 11 | * open source and self-hosting capabilities. 12 | * 13 | * Written in JavaScript, interacting with the library written 14 | * in Python, allows communication with ChatGPT through the use 15 | * of different services that facilitate its use by the public. 16 | * 17 | * For related information - https://github.com/CodeWithRodi/Lovelace/ 18 | * See also - https://github.com/xtekky/gpt4free 19 | * 20 | * :: https://lovelace.codewithrodi.com/ 21 | * :: https://lovelace-backend.codewithrodi.com/ 22 | * :: https://lovelace-docs.codewithrodi.com/ 23 | * 24 | * =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 25 | ****/ 26 | 27 | import React, { useEffect } from 'react'; 28 | 29 | const UseWindowSize = () => { 30 | const [GetWindowSize, SetWindowSize] = React.useState({ 31 | Width: window.innerWidth, 32 | Height: window.innerHeight 33 | }); 34 | 35 | const ChangeWindowSize = () => ( 36 | SetWindowSize({ Width: window.innerWidth, Height: window.innerHeight })); 37 | 38 | useEffect(() => { 39 | window.addEventListener('resize', ChangeWindowSize); 40 | return () => { 41 | window.removeEventListener('resize', ChangeWindowSize); 42 | }; 43 | }, []); 44 | 45 | return GetWindowSize; 46 | }; 47 | 48 | export default UseWindowSize; -------------------------------------------------------------------------------- /Client/src/Application.jsx: -------------------------------------------------------------------------------- 1 | /*** 2 | * Copyright (C) Rodolfo Herrera Hernandez. All rights reserved. 3 | * Licensed under the MIT license. See LICENSE file in the project root 4 | * for full license information. 5 | * 6 | * =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 7 | * 8 | * In the vast universe of knowledge, the Open Source philosophy 9 | * shines like a radiant star. In this vein, Lovelace emerges 10 | * as an autonomous alternative to ChatGPT, based on 11 | * open source and self-hosting capabilities. 12 | * 13 | * Written in JavaScript, interacting with the library written 14 | * in Python, allows communication with ChatGPT through the use 15 | * of different services that facilitate its use by the public. 16 | * 17 | * For related information - https://github.com/CodeWithRodi/Lovelace/ 18 | * See also - https://github.com/xtekky/gpt4free 19 | * 20 | * :: https://lovelace.codewithrodi.com/ 21 | * :: https://lovelace-backend.codewithrodi.com/ 22 | * :: https://lovelace-docs.codewithrodi.com/ 23 | * 24 | * =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 25 | ****/ 26 | 27 | import React from 'react'; 28 | import { Routes as RoutesBox, Route, useLocation } from 'react-router-dom'; 29 | import Layout from './Components/General/Layout/Layout'; 30 | import Pages from './Pages'; 31 | 32 | const Application = () => { 33 | const Location = useLocation(); 34 | return ( 35 | 36 | }> 37 | } /> 38 | } /> 39 | } /> 40 | 41 | 42 | ); 43 | }; 44 | 45 | export default Application; -------------------------------------------------------------------------------- /Client/src/Utilities/Algorithms.js: -------------------------------------------------------------------------------- 1 | /*** 2 | * Copyright (C) Rodolfo Herrera Hernandez. All rights reserved. 3 | * Licensed under the MIT license. See LICENSE file in the project root 4 | * for full license information. 5 | * 6 | * =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 7 | * 8 | * In the vast universe of knowledge, the Open Source philosophy 9 | * shines like a radiant star. In this vein, Lovelace emerges 10 | * as an autonomous alternative to ChatGPT, based on 11 | * open source and self-hosting capabilities. 12 | * 13 | * Written in JavaScript, interacting with the library written 14 | * in Python, allows communication with ChatGPT through the use 15 | * of different services that facilitate its use by the public. 16 | * 17 | * For related information - https://github.com/CodeWithRodi/Lovelace/ 18 | * See also - https://github.com/xtekky/gpt4free 19 | * 20 | * :: https://lovelace.codewithrodi.com/ 21 | * :: https://lovelace-backend.codewithrodi.com/ 22 | * :: https://lovelace-docs.codewithrodi.com/ 23 | * 24 | * =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 25 | ****/ 26 | 27 | export const MergeObjectValues = (To, From) => { 28 | for(const Value in From){ 29 | if(typeof To[Value] != 'object') 30 | To[Value] = From[Value]; 31 | else if(typeof From[Value] === 'object') 32 | To[Value] = MergeObjectValues(To[Value], From[Value]); 33 | } 34 | return To; 35 | }; 36 | 37 | export const ReplaceURLParameters = (URL, Parameters = []) => ( 38 | URL.split(':').map((Value) => (Value.startsWith('/') && Value.endsWith('/')) ? (Value) : (Parameters.shift())) 39 | ).join(''); 40 | 41 | export const FormatChatResponseListDate = (ToFormatDate) => new Date(Date.UTC(...ToFormatDate.split('-')) 42 | ).toLocaleString(navigator.language, { weekday: 'long', year: 'numeric', month: 'long', day: 'numeric' }); -------------------------------------------------------------------------------- /Documentation/src/components/HomepageFeatures/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import clsx from 'clsx'; 3 | import styles from './styles.module.css'; 4 | 5 | const FeatureList = [ 6 | { 7 | title: 'Easy to Use', 8 | Svg: require('@site/static/img/undraw_docusaurus_mountain.svg').default, 9 | description: ( 10 | <> 11 | Docusaurus was designed from the ground up to be easily installed and 12 | used to get your website up and running quickly. 13 | 14 | ), 15 | }, 16 | { 17 | title: 'Focus on What Matters', 18 | Svg: require('@site/static/img/undraw_docusaurus_tree.svg').default, 19 | description: ( 20 | <> 21 | Docusaurus lets you focus on your docs, and we'll do the chores. Go 22 | ahead and move your docs into the docs directory. 23 | 24 | ), 25 | }, 26 | { 27 | title: 'Powered by React', 28 | Svg: require('@site/static/img/undraw_docusaurus_react.svg').default, 29 | description: ( 30 | <> 31 | Extend or customize your website layout by reusing React. Docusaurus can 32 | be extended while reusing the same header and footer. 33 | 34 | ), 35 | }, 36 | ]; 37 | 38 | function Feature({Svg, title, description}) { 39 | return ( 40 |
41 |
42 | 43 |
44 |
45 |

{title}

46 |

{description}

47 |
48 |
49 | ); 50 | } 51 | 52 | export default function HomepageFeatures() { 53 | return ( 54 |
55 |
56 |
57 | {FeatureList.map((props, idx) => ( 58 | 59 | ))} 60 |
61 |
62 |
63 | ); 64 | } 65 | -------------------------------------------------------------------------------- /Client/src/Components/Chat/MobileActivityMenu/MobileActivityMenu.css: -------------------------------------------------------------------------------- 1 | /*** 2 | * Copyright (C) Rodolfo Herrera Hernandez. All rights reserved. 3 | * Licensed under the MIT license. See LICENSE file in the project root 4 | * for full license information. 5 | * 6 | * =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 7 | * 8 | * In the vast universe of knowledge, the Open Source philosophy 9 | * shines like a radiant star. In this vein, Lovelace emerges 10 | * as an autonomous alternative to ChatGPT, based on 11 | * open source and self-hosting capabilities. 12 | * 13 | * Written in JavaScript, interacting with the library written 14 | * in Python, allows communication with ChatGPT through the use 15 | * of different services that facilitate its use by the public. 16 | * 17 | * For related information - https://github.com/CodeWithRodi/Lovelace/ 18 | * See also - https://github.com/xtekky/gpt4free 19 | * 20 | * :: https://lovelace.codewithrodi.com/ 21 | * :: https://lovelace-backend.codewithrodi.com/ 22 | * :: https://lovelace-docs.codewithrodi.com/ 23 | * 24 | * =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 25 | ****/ 26 | 27 | #Mobile-Activity-Menu{ 28 | position: fixed; 29 | display: flex; 30 | align-items: end; 31 | justify-content: center; 32 | z-index: 100; 33 | width: 100%; 34 | height: 100%; 35 | } 36 | 37 | #Mobile-Activity-Content-Box{ 38 | background-color: #222327; 39 | border-radius: unset; 40 | overflow-y: scroll; 41 | height: 70%; 42 | width: 100%; 43 | padding: 1rem; 44 | border-top-left-radius: 1rem; 45 | border-top-right-radius: 1rem; 46 | } 47 | 48 | #Mobile-Activity-Header-Box{ 49 | display: flex; 50 | width: 100%; 51 | margin-bottom: 2rem; 52 | align-items: center; 53 | justify-content: space-between; 54 | } 55 | 56 | #Mobile-Activity-Title{ 57 | font-size: 1.3rem; 58 | } 59 | 60 | #Mobile-Activity-Icon-Box{ 61 | color: #FFFFFF; 62 | } -------------------------------------------------------------------------------- /Client/src/Components/General/LovelaceAnimation/LovelaceAnimation.css: -------------------------------------------------------------------------------- 1 | /*** 2 | * Copyright (C) Rodolfo Herrera Hernandez. All rights reserved. 3 | * Licensed under the MIT license. See LICENSE file in the project root 4 | * for full license information. 5 | * 6 | * =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 7 | * 8 | * In the vast universe of knowledge, the Open Source philosophy 9 | * shines like a radiant star. In this vein, Lovelace emerges 10 | * as an autonomous alternative to ChatGPT, based on 11 | * open source and self-hosting capabilities. 12 | * 13 | * Written in JavaScript, interacting with the library written 14 | * in Python, allows communication with ChatGPT through the use 15 | * of different services that facilitate its use by the public. 16 | * 17 | * For related information - https://github.com/CodeWithRodi/Lovelace/ 18 | * See also - https://github.com/xtekky/gpt4free 19 | * 20 | * :: https://lovelace.codewithrodi.com/ 21 | * :: https://lovelace-backend.codewithrodi.com/ 22 | * :: https://lovelace-docs.codewithrodi.com/ 23 | * 24 | * =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 25 | ****/ 26 | 27 | #Lovelace-Animation-Box{ 28 | display: flex; 29 | justify-content: center; 30 | align-items: center; 31 | width: 100%; 32 | height: 100vh; 33 | position: absolute; 34 | z-index: 100; 35 | } 36 | 37 | #Firework-Canvas{ 38 | position: absolute; 39 | z-index: 50; 40 | } 41 | 42 | #Lovelace-Animation-Box .Title{ 43 | font-weight: 200; 44 | font-size: 2.7rem; 45 | text-transform: uppercase; 46 | letter-spacing: 0.5rem; 47 | } 48 | 49 | #Lovelace-Animation-Box .Title .Letter{ 50 | display: inline-block; 51 | line-height: 1rem; 52 | } 53 | 54 | @media screen and (max-width: 768px){ 55 | #Lovelace-Animation-Box .Title{ 56 | letter-spacing: 0.4rem; 57 | } 58 | 59 | #Lovelace-Animation-Box .Title{ 60 | font-size: 1.8rem; 61 | } 62 | } -------------------------------------------------------------------------------- /Server/.env: -------------------------------------------------------------------------------- 1 | # =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 2 | # Copyright (C) Rodolfo Herrera Hernandez. All rights reserved. 3 | # Licensed under the MIT license. See LICENSE file in the project root 4 | # for full license information. 5 | # 6 | # =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 7 | # 8 | # In the vast universe of knowledge, the Open Source philosophy 9 | # shines like a radiant star. In this vein, Lovelace emerges 10 | # as an autonomous alternative to ChatGPT, based on 11 | # open source and self-hosting capabilities. 12 | # 13 | # Written in JavaScript, interacting with the library written 14 | # in Python, allows communication with ChatGPT through the use 15 | # of different services that facilitate its use by the public. 16 | # 17 | # For related information - https://github.com/CodeWithRodi/Lovelace/ 18 | # See also - https://github.com/xtekky/gpt4free 19 | # 20 | # :: https://lovelace.codewithrodi.com/ 21 | # :: https://lovelace-backend.codewithrodi.com/ 22 | # :: https://lovelace-docs.codewithrodi.com/ 23 | # =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 24 | 25 | # Specifies the execution mode of the server, considers the value of 26 | # can be and . 27 | NODE_ENV = production 28 | 29 | # Address of the server where the client application is running. 30 | CLIENT_HOST = http://0.0.0.0:5173/ 31 | 32 | # Port where the server will 33 | # start executing over the network. 34 | SERVER_PORT = 8000 35 | 36 | # Hostname where the server will be launched in 37 | # complement with the previously established 38 | # port on the network. 39 | SERVER_HOST = 0.0.0.0 40 | 41 | # If you have an SSL certificate, you must 42 | # specify the certificate and then the key. 43 | SSL_CERT = 44 | SSL_KEY = 45 | 46 | # Time in minutes to check for package updates required for Lovelace to function. 47 | TIME_FOR_CHECK_AND_UPDATE_PACKAGES = 3 48 | 49 | # Others... 50 | CORS_ORIGIN = * 51 | 52 | BODY_MAX_SIZE = 100kb -------------------------------------------------------------------------------- /Client/src/Components/Chat/MobileOptions/MobileOptions.css: -------------------------------------------------------------------------------- 1 | /*** 2 | * Copyright (C) Rodolfo Herrera Hernandez. All rights reserved. 3 | * Licensed under the MIT license. See LICENSE file in the project root 4 | * for full license information. 5 | * 6 | * =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 7 | * 8 | * In the vast universe of knowledge, the Open Source philosophy 9 | * shines like a radiant star. In this vein, Lovelace emerges 10 | * as an autonomous alternative to ChatGPT, based on 11 | * open source and self-hosting capabilities. 12 | * 13 | * Written in JavaScript, interacting with the library written 14 | * in Python, allows communication with ChatGPT through the use 15 | * of different services that facilitate its use by the public. 16 | * 17 | * For related information - https://github.com/CodeWithRodi/Lovelace/ 18 | * See also - https://github.com/xtekky/gpt4free 19 | * 20 | * :: https://lovelace.codewithrodi.com/ 21 | * :: https://lovelace-backend.codewithrodi.com/ 22 | * :: https://lovelace-docs.codewithrodi.com/ 23 | * 24 | * =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 25 | ****/ 26 | 27 | #Mobile-Options-Box{ 28 | margin: 0 auto; 29 | display: flex; 30 | align-items: center; 31 | gap: 1rem; 32 | width: calc(100% - 2rem); 33 | background-color: #000000; 34 | } 35 | 36 | #Mobile-Options-Box .Button{ 37 | padding: .4rem 1rem; 38 | text-align: start; 39 | font-size: .65rem; 40 | overflow: hidden; 41 | } 42 | 43 | .hidingHeader{ 44 | --hidingHeader-animation-offset: 60px !important; 45 | position: absolute !important; 46 | top: 0; 47 | } 48 | 49 | #Mobile-Options-Box .Button span{ 50 | white-space: nowrap; 51 | text-overflow: ellipsis; 52 | overflow: hidden; 53 | 54 | @supports (-webkit-line-clamp: 1){ 55 | overflow: hidden; 56 | text-overflow: ellipsis; 57 | white-space: initial; 58 | display: -webkit-box; 59 | -webkit-line-clamp: 1; 60 | -webkit-box-orient: vertical; 61 | } 62 | } -------------------------------------------------------------------------------- /Client/src/Components/General/LanguageSelect/LanguageSelect.css: -------------------------------------------------------------------------------- 1 | /*** 2 | * Copyright (C) Rodolfo Herrera Hernandez. All rights reserved. 3 | * Licensed under the MIT license. See LICENSE file in the project root 4 | * for full license information. 5 | * 6 | * =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 7 | * 8 | * In the vast universe of knowledge, the Open Source philosophy 9 | * shines like a radiant star. In this vein, Lovelace emerges 10 | * as an autonomous alternative to ChatGPT, based on 11 | * open source and self-hosting capabilities. 12 | * 13 | * Written in JavaScript, interacting with the library written 14 | * in Python, allows communication with ChatGPT through the use 15 | * of different services that facilitate its use by the public. 16 | * 17 | * For related information - https://github.com/CodeWithRodi/Lovelace/ 18 | * See also - https://github.com/xtekky/gpt4free 19 | * 20 | * :: https://lovelace.codewithrodi.com/ 21 | * :: https://lovelace-backend.codewithrodi.com/ 22 | * :: https://lovelace-docs.codewithrodi.com/ 23 | * 24 | * =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 25 | ****/ 26 | 27 | #Language-Select-Box{ 28 | margin: 0; 29 | width: auto; 30 | } 31 | 32 | #Language-Select-Box .MuiOutlinedInput-root{ 33 | border-radius: 0; 34 | font-size: .8rem; 35 | } 36 | 37 | #Language-Select-Box .MuiInputBase-input{ 38 | padding: 4.5px 32px 4.5px 14px !important; 39 | } 40 | 41 | #Language-Select-Box .MuiOutlinedInput-notchedOutline{ 42 | border-color: #FFFFFF; 43 | } 44 | 45 | #Language-Select-Box .MuiInputLabel-root, 46 | #Language-Select-Box .MuiSvgIcon-root, 47 | #Language-Select-Box .MuiOutlinedInput-root{ 48 | color: #FFFFFF; 49 | } 50 | 51 | @media screen and (max-width: 768px){ 52 | #Language-Select-Paper-Box{ 53 | min-width: 50px !important; 54 | width: 50px !important; 55 | } 56 | 57 | #Language-Select-Box .MuiInputBase-input{ 58 | padding: 3.5px 32px 3.5px 14px !important; 59 | } 60 | 61 | #Language-Select-Paper-Box .MuiMenuItem-root{ 62 | font-size: .5rem; 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /Client/src/Components/Chat/RenderResponse/RenderResponse.css: -------------------------------------------------------------------------------- 1 | /*** 2 | * Copyright (C) Rodolfo Herrera Hernandez. All rights reserved. 3 | * Licensed under the MIT license. See LICENSE file in the project root 4 | * for full license information. 5 | * 6 | * =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 7 | * 8 | * In the vast universe of knowledge, the Open Source philosophy 9 | * shines like a radiant star. In this vein, Lovelace emerges 10 | * as an autonomous alternative to ChatGPT, based on 11 | * open source and self-hosting capabilities. 12 | * 13 | * Written in JavaScript, interacting with the library written 14 | * in Python, allows communication with ChatGPT through the use 15 | * of different services that facilitate its use by the public. 16 | * 17 | * For related information - https://github.com/CodeWithRodi/Lovelace/ 18 | * See also - https://github.com/xtekky/gpt4free 19 | * 20 | * :: https://lovelace.codewithrodi.com/ 21 | * :: https://lovelace-backend.codewithrodi.com/ 22 | * :: https://lovelace-docs.codewithrodi.com/ 23 | * 24 | * =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 25 | ****/ 26 | 27 | .Render-Response-Box[data-discipline='Server']{ 28 | background-color: #121212; 29 | } 30 | 31 | .Render-Response-Box[data-discipline='Server'] .Render-Response-Icon-Box{ 32 | margin-top: 2.7px; 33 | } 34 | 35 | .Render-Response-Icon-Box{ 36 | display: flex; 37 | justify-content: center; 38 | align-items: center; 39 | } 40 | 41 | .Render-Response-Box{ 42 | width: 99%; 43 | padding: 1rem; 44 | border-radius: 1rem; 45 | display: flex; 46 | align-items: flex-start; 47 | gap: 1rem; 48 | color: #FFFFFF; 49 | } 50 | 51 | .Render-Response-Content-Box{ 52 | display: flex; 53 | flex-direction: column; 54 | gap: 1rem; 55 | } 56 | 57 | @media screen and (max-width: 768px){ 58 | .Render-Response-Box{ 59 | border-radius: 0; 60 | padding: .5rem 1rem; 61 | } 62 | 63 | .Render-Response-Box[data-discipline='Server'] .Render-Response-Icon-Box{ 64 | margin-top: 0; 65 | } 66 | 67 | .Render-Response-Box[data-discipline='Server']{ 68 | background-color: #000000; 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /Server/Controllers/Error.js: -------------------------------------------------------------------------------- 1 | /*** 2 | * Copyright (C) Rodolfo Herrera Hernandez. All rights reserved. 3 | * Licensed under the MIT license. See LICENSE file in the project root 4 | * for full license information. 5 | * 6 | * =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 7 | * 8 | * In the vast universe of knowledge, the Open Source philosophy 9 | * shines like a radiant star. In this vein, Lovelace emerges 10 | * as an autonomous alternative to ChatGPT, based on 11 | * open source and self-hosting capabilities. 12 | * 13 | * Written in JavaScript, interacting with the library written 14 | * in Python, allows communication with ChatGPT through the use 15 | * of different services that facilitate its use by the public. 16 | * 17 | * For related information - https://github.com/CodeWithRodi/Lovelace/ 18 | * See also - https://github.com/xtekky/gpt4free 19 | * 20 | * :: https://lovelace.codewithrodi.com/ 21 | * :: https://lovelace-backend.codewithrodi.com/ 22 | * :: https://lovelace-docs.codewithrodi.com/ 23 | * 24 | * =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 25 | ****/ 26 | 27 | const ReportError = (ErrorRaised, Response) => { 28 | if(process.env.NODE_ENV === 'development' && !ErrorRaised.IsOperational) 29 | Response.status(ErrorRaised.StatusCode).json({ 30 | Status: ErrorRaised.Status, 31 | Message: ErrorRaised.message, 32 | Stack: ErrorRaised.stack, 33 | Error: ErrorRaised 34 | }); 35 | else if(ErrorRaised.IsOperational){ 36 | Response.status(500).json({ 37 | Status: ErrorRaised.Status, 38 | Message: ErrorRaised.message, 39 | ...(process.env.NODE_ENV === 'development') && ({ Exception: ErrorRaised.Exception }) 40 | }); 41 | }else{ 42 | Response.status(500).json({ 43 | Status: 'Server Error', 44 | Message: 'Internal Server Error' 45 | }); 46 | } 47 | }; 48 | 49 | module.exports = (RaisedError, _, Response, __) => { 50 | console.log(RaisedError); 51 | RaisedError.StatusCode = RaisedError.StatusCode || 500; 52 | RaisedError.Status = RaisedError.Status || 'Server Error'; 53 | ReportError(RaisedError, Response); 54 | } -------------------------------------------------------------------------------- /Client/src/index.jsx: -------------------------------------------------------------------------------- 1 | /*** 2 | * Copyright (C) Rodolfo Herrera Hernandez. All rights reserved. 3 | * Licensed under the MIT license. See LICENSE file in the project root 4 | * for full license information. 5 | * 6 | * =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 7 | * 8 | * In the vast universe of knowledge, the Open Source philosophy 9 | * shines like a radiant star. In this vein, Lovelace emerges 10 | * as an autonomous alternative to ChatGPT, based on 11 | * open source and self-hosting capabilities. 12 | * 13 | * Written in JavaScript, interacting with the library written 14 | * in Python, allows communication with ChatGPT through the use 15 | * of different services that facilitate its use by the public. 16 | * 17 | * For related information - https://github.com/CodeWithRodi/Lovelace/ 18 | * See also - https://github.com/xtekky/gpt4free 19 | * 20 | * :: https://lovelace.codewithrodi.com/ 21 | * :: https://lovelace-backend.codewithrodi.com/ 22 | * :: https://lovelace-docs.codewithrodi.com/ 23 | * 24 | * =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 25 | ****/ 26 | 27 | import React from 'react'; 28 | import ReactDOM from 'react-dom/client'; 29 | import ScrollToTop from './Components/General/ScrollToTop.jsx'; 30 | import Application from './Application.jsx'; 31 | import * as EvergreenUI from 'evergreen-ui'; 32 | import { MultiProvider } from 'react-pendulum'; 33 | import { BrowserRouter } from 'react-router-dom'; 34 | import { ChatProvider } from './Services/Chat/Context.jsx'; 35 | import { CoreProvider } from './Services/Core/Context.jsx'; 36 | import { MergeObjectValues } from './Utilities/Algorithms.js'; 37 | import './Assets/StyleSheets/General.css'; 38 | 39 | const EvergreenTheme = MergeObjectValues(EvergreenUI.defaultTheme, { 40 | colors: { blue500: '#FFFFFF' } 41 | }); 42 | 43 | ReactDOM.createRoot(document.getElementById('Lovelace-ROOT')).render( 44 | , 47 | , 48 | , 49 | , 50 | 51 | ]} 52 | > 53 | 54 | 55 | ); -------------------------------------------------------------------------------- /Client/src/Components/General/MenuIcon/MenuIcon.jsx: -------------------------------------------------------------------------------- 1 | /*** 2 | * Copyright (C) Rodolfo Herrera Hernandez. All rights reserved. 3 | * Licensed under the MIT license. See LICENSE file in the project root 4 | * for full license information. 5 | * 6 | * =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 7 | * 8 | * In the vast universe of knowledge, the Open Source philosophy 9 | * shines like a radiant star. In this vein, Lovelace emerges 10 | * as an autonomous alternative to ChatGPT, based on 11 | * open source and self-hosting capabilities. 12 | * 13 | * Written in JavaScript, interacting with the library written 14 | * in Python, allows communication with ChatGPT through the use 15 | * of different services that facilitate its use by the public. 16 | * 17 | * For related information - https://github.com/CodeWithRodi/Lovelace/ 18 | * See also - https://github.com/xtekky/gpt4free 19 | * 20 | * :: https://lovelace.codewithrodi.com/ 21 | * :: https://lovelace-backend.codewithrodi.com/ 22 | * :: https://lovelace-docs.codewithrodi.com/ 23 | * 24 | * =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 25 | ****/ 26 | 27 | import React from 'react'; 28 | import './MenuIcon.css'; 29 | 30 | const MenuIcon = ({ IsActive, ...Props }) => ( 31 | 57 | ); 58 | 59 | export default MenuIcon; -------------------------------------------------------------------------------- /Client/src/Pages/Everybody/Home/Home.jsx: -------------------------------------------------------------------------------- 1 | /*** 2 | * Copyright (C) Rodolfo Herrera Hernandez. All rights reserved. 3 | * Licensed under the MIT license. See LICENSE file in the project root 4 | * for full license information. 5 | * 6 | * =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 7 | * 8 | * In the vast universe of knowledge, the Open Source philosophy 9 | * shines like a radiant star. In this vein, Lovelace emerges 10 | * as an autonomous alternative to ChatGPT, based on 11 | * open source and self-hosting capabilities. 12 | * 13 | * Written in JavaScript, interacting with the library written 14 | * in Python, allows communication with ChatGPT through the use 15 | * of different services that facilitate its use by the public. 16 | * 17 | * For related information - https://github.com/CodeWithRodi/Lovelace/ 18 | * See also - https://github.com/xtekky/gpt4free 19 | * 20 | * :: https://lovelace.codewithrodi.com/ 21 | * :: https://lovelace-backend.codewithrodi.com/ 22 | * :: https://lovelace-docs.codewithrodi.com/ 23 | * 24 | * =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 25 | ****/ 26 | 27 | import React, { useEffect, useContext, useRef } from 'react'; 28 | import { ChatContext } from '../../../Services/Chat/Context'; 29 | import SideMenu from '../../../Components/Chat/SideMenu'; 30 | import UseWindowSize from '../../../Hooks/UseWindowSize'; 31 | import MobileOptions from '../../../Components/Chat/MobileOptions'; 32 | import ChatViewer from '../../../Components/Chat/ChatViewer'; 33 | import './Home.css'; 34 | 35 | const HomePage = () => { 36 | const ChatNodeReference = useRef(null); 37 | const { ServerCommunication } = useContext(ChatContext); 38 | const { Width } = UseWindowSize(); 39 | 40 | useEffect(() => { 41 | (ChatNodeReference.current) && (ChatNodeReference.current.scrollTop = ChatNodeReference.current.scrollHeight); 42 | }, [ServerCommunication.GetAPIResponses, ServerCommunication.GetStreamedResponses]); 43 | 44 | return ( 45 |
46 | {(Width > 768) ? : } 47 | 48 |
49 | 50 |
51 |
52 | ); 53 | }; 54 | 55 | export default HomePage; -------------------------------------------------------------------------------- /Client/src/Components/General/LanguageSelect/LanguageSelect.jsx: -------------------------------------------------------------------------------- 1 | /*** 2 | * Copyright (C) Rodolfo Herrera Hernandez. All rights reserved. 3 | * Licensed under the MIT license. See LICENSE file in the project root 4 | * for full license information. 5 | * 6 | * =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 7 | * 8 | * In the vast universe of knowledge, the Open Source philosophy 9 | * shines like a radiant star. In this vein, Lovelace emerges 10 | * as an autonomous alternative to ChatGPT, based on 11 | * open source and self-hosting capabilities. 12 | * 13 | * Written in JavaScript, interacting with the library written 14 | * in Python, allows communication with ChatGPT through the use 15 | * of different services that facilitate its use by the public. 16 | * 17 | * For related information - https://github.com/CodeWithRodi/Lovelace/ 18 | * See also - https://github.com/xtekky/gpt4free 19 | * 20 | * :: https://lovelace.codewithrodi.com/ 21 | * :: https://lovelace-backend.codewithrodi.com/ 22 | * :: https://lovelace-docs.codewithrodi.com/ 23 | * 24 | * =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 25 | ****/ 26 | 27 | import React, { useContext } from 'react'; 28 | import { MenuItem, Tooltip } from '@mui/material'; 29 | import { CoreContext } from '../../../Services/Core/Context'; 30 | import { GetAvailableLocales } from '../../../Locale'; 31 | import Select from '../Select'; 32 | import './LanguageSelect.css'; 33 | 34 | const LanguageSelect = () => { 35 | const { GetSelectedLanguage, SetSelectedLanguage, L } = useContext(CoreContext); 36 | 37 | return ( 38 | 39 |
40 | 51 |
52 |
53 | ); 54 | }; 55 | 56 | export default LanguageSelect; -------------------------------------------------------------------------------- /Server/Utilities/BootHelper.js: -------------------------------------------------------------------------------- 1 | /*** 2 | * Copyright (C) Rodolfo Herrera Hernandez. All rights reserved. 3 | * Licensed under the MIT license. See LICENSE file in the project root 4 | * for full license information. 5 | * 6 | * =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 7 | * 8 | * In the vast universe of knowledge, the Open Source philosophy 9 | * shines like a radiant star. In this vein, Lovelace emerges 10 | * as an autonomous alternative to ChatGPT, based on 11 | * open source and self-hosting capabilities. 12 | * 13 | * Written in JavaScript, interacting with the library written 14 | * in Python, allows communication with ChatGPT through the use 15 | * of different services that facilitate its use by the public. 16 | * 17 | * For related information - https://github.com/CodeWithRodi/Lovelace/ 18 | * See also - https://github.com/xtekky/gpt4free 19 | * 20 | * :: https://lovelace.codewithrodi.com/ 21 | * :: https://lovelace-backend.codewithrodi.com/ 22 | * :: https://lovelace-docs.codewithrodi.com/ 23 | * 24 | * =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 25 | ****/ 26 | 27 | const Https = require('https'); 28 | const Http = require('http'); 29 | const { CapitalizeToLowerCaseWithDelimitier } = require('./Algorithms'); 30 | 31 | exports.StandarizedBindingToApplication = ({ Application, Routes, Suffix, Middlewares, Settings }) => { 32 | (Middlewares).forEach((Middleware) => ( 33 | Application.use(...[((Array.isArray(Middleware)) 34 | ? ((typeof Middleware[0] === 'string') ? (Middleware[0], Middleware[1]) 35 | : (Middleware[0](Middleware[1]))) 36 | : (Middleware()))]) 37 | )); 38 | (Routes).forEach((Route) => ( 39 | Application.use(Suffix + CapitalizeToLowerCaseWithDelimitier(Route), require(`../Routes/${Route}`)) 40 | )); 41 | (Settings.Deactivated).forEach((DeactivatedSetting) => Application.disabled(DeactivatedSetting)); 42 | } 43 | 44 | exports.GetConfiguredHTTPServerInstance = (Application) => { 45 | Http.globalAgent.maxSockets = Https.globalAgent.maxSockets = Infinity; 46 | const SSL = [process.env.SSL_CERT, process.env.SSL_KEY]; 47 | return ((SSL[0]) ? (Https.createServer) : (Http.createServer))({ 48 | key: (SSL[0]) ? (FileSystem.readFileSync(SSL[0])) : (undefined), 49 | cert: (SSL[1]) ? (FileSystem.readFileSync(SSL[1])) : (undefined) 50 | }, Application); 51 | }; -------------------------------------------------------------------------------- /Server/Utilities/Runtime.js: -------------------------------------------------------------------------------- 1 | /*** 2 | * Copyright (C) Rodolfo Herrera Hernandez. All rights reserved. 3 | * Licensed under the MIT license. See LICENSE file in the project root 4 | * for full license information. 5 | * 6 | * =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 7 | * 8 | * In the vast universe of knowledge, the Open Source philosophy 9 | * shines like a radiant star. In this vein, Lovelace emerges 10 | * as an autonomous alternative to ChatGPT, based on 11 | * open source and self-hosting capabilities. 12 | * 13 | * Written in JavaScript, interacting with the library written 14 | * in Python, allows communication with ChatGPT through the use 15 | * of different services that facilitate its use by the public. 16 | * 17 | * For related information - https://github.com/CodeWithRodi/Lovelace/ 18 | * See also - https://github.com/xtekky/gpt4free 19 | * 20 | * :: https://lovelace.codewithrodi.com/ 21 | * :: https://lovelace-backend.codewithrodi.com/ 22 | * :: https://lovelace-docs.codewithrodi.com/ 23 | * 24 | * =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 25 | ****/ 26 | 27 | exports.AvailableProviders = { 28 | 'WS': [ 29 | 'Bing', 30 | 'GeekGpt', 31 | 'Phind', 32 | 'ChatBase', 33 | 'GptGo', 34 | 'ChatForAi', 35 | 'AiAsk', 36 | 'Automatic', 37 | 'GPTalk', 38 | ], 39 | 'API': [ 40 | 'GptGo', 41 | 'GeekGpt', 42 | 'GPTalk', 43 | 'ChatForAi', 44 | 'Aichat', 45 | 'ChatBase', 46 | 'AiAsk', 47 | 'Phind', 48 | 'Acytoo', 49 | 'Bing', 50 | 'You', 51 | 'Automatic' 52 | ] 53 | }; 54 | exports.AvailableRoles = ['user', 'assistant', 'system']; 55 | exports.AvailableModels = ['gpt-3.5-turbo', 'gpt-4']; 56 | 57 | exports.DefaultChatParameters = { 58 | Model: 'gpt-3.5-turbo', 59 | Role: 'user', 60 | Provider: 'Automatic' 61 | }; 62 | 63 | exports.RuntimeError = class extends Error{ 64 | constructor(Message, StatusCode, Exception){ 65 | super(Message); 66 | this.Exception = Exception; 67 | this.StatusCode = StatusCode; 68 | this.Status = `${StatusCode}`.startsWith(4) ? 'Client Error' : 'Server Error'; 69 | this.IsOperational = true; 70 | Error.captureStackTrace(this, this.constructor); 71 | } 72 | }; 73 | 74 | exports.CatchAsync = (AsyncFunction) => (Request, Response, Next, ...Arguments) => 75 | AsyncFunction(Request, Response, Next, ...Arguments).catch(Next); -------------------------------------------------------------------------------- /Client/src/Components/General/Select.jsx: -------------------------------------------------------------------------------- 1 | /*** 2 | * Copyright (C) Rodolfo Herrera Hernandez. All rights reserved. 3 | * Licensed under the MIT license. See LICENSE file in the project root 4 | * for full license information. 5 | * 6 | * =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 7 | * 8 | * In the vast universe of knowledge, the Open Source philosophy 9 | * shines like a radiant star. In this vein, Lovelace emerges 10 | * as an autonomous alternative to ChatGPT, based on 11 | * open source and self-hosting capabilities. 12 | * 13 | * Written in JavaScript, interacting with the library written 14 | * in Python, allows communication with ChatGPT through the use 15 | * of different services that facilitate its use by the public. 16 | * 17 | * For related information - https://github.com/CodeWithRodi/Lovelace/ 18 | * See also - https://github.com/xtekky/gpt4free 19 | * 20 | * :: https://lovelace.codewithrodi.com/ 21 | * :: https://lovelace-backend.codewithrodi.com/ 22 | * :: https://lovelace-docs.codewithrodi.com/ 23 | * 24 | * =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 25 | ****/ 26 | 27 | import React from 'react'; 28 | import { 29 | Select as MUISelect, 30 | OutlinedInput, 31 | FormControl, 32 | InputLabel, 33 | FormHelperText } from '@mui/material'; 34 | 35 | const Select = ({ 36 | Label, 37 | Value, 38 | OnChange, 39 | children, 40 | HelperText, 41 | FormControlProps, 42 | SelectProps, 43 | ItemBoxProps, 44 | PaperProps 45 | }) => ( 46 | 47 | {Label} 48 | } 53 | MenuProps={{ 54 | PaperProps: { 55 | style: { 56 | maxHeight: 48 * 4.5 + 8, 57 | width: 250, 58 | backgroundColor: '#222327', 59 | color: '#FFFFFF', 60 | ...ItemBoxProps, 61 | }, 62 | ...PaperProps 63 | } 64 | }} 65 | {...SelectProps} 66 | > 67 | {children} 68 | 69 | {(HelperText) && ( 70 | {HelperText} 71 | )} 72 | 73 | ); 74 | 75 | export default Select; -------------------------------------------------------------------------------- /Client/src/Components/Chat/MobileOptions/MobileOptions.jsx: -------------------------------------------------------------------------------- 1 | /*** 2 | * Copyright (C) Rodolfo Herrera Hernandez. All rights reserved. 3 | * Licensed under the MIT license. See LICENSE file in the project root 4 | * for full license information. 5 | * 6 | * =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 7 | * 8 | * In the vast universe of knowledge, the Open Source philosophy 9 | * shines like a radiant star. In this vein, Lovelace emerges 10 | * as an autonomous alternative to ChatGPT, based on 11 | * open source and self-hosting capabilities. 12 | * 13 | * Written in JavaScript, interacting with the library written 14 | * in Python, allows communication with ChatGPT through the use 15 | * of different services that facilitate its use by the public. 16 | * 17 | * For related information - https://github.com/CodeWithRodi/Lovelace/ 18 | * See also - https://github.com/xtekky/gpt4free 19 | * 20 | * :: https://lovelace.codewithrodi.com/ 21 | * :: https://lovelace-backend.codewithrodi.com/ 22 | * :: https://lovelace-docs.codewithrodi.com/ 23 | * 24 | * =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 25 | ****/ 26 | 27 | import React, { useContext } from 'react'; 28 | import { ChatContext } from '../../../Services/Chat/Context'; 29 | import { CoreContext } from '../../../Services/Core/Context'; 30 | import { Tooltip } from '@mui/material'; 31 | import { HidingHeader } from 'hiding-header-react' 32 | import './MobileOptions.css'; 33 | import 'hiding-header/dist/style.css' 34 | 35 | const MobileOptions = () => { 36 | const { UserExperience, HandleChatReset } = useContext(ChatContext); 37 | const { L } = useContext(CoreContext); 38 | 39 | return ( 40 | 41 |
42 | {([ 43 | [L('MOBILE_OPTIONS_SETTINGS'), L('TOOLTIP_SIDE_MENU_SETTINGS'), () => UserExperience.SetIsSettingsMenuActive(true)], 44 | [L('MOBILE_OPTIONS_ACTIVITY'), L('TOOLTIP_MY_ACTIVITY'), () => UserExperience.SetIsMobileActivityMenuActive(true)], 45 | [L('MOBILE_OPTIONS_RESET_CHAT'), L('TOOLTIP_RESET_CHAT'), HandleChatReset] 46 | ].map(([ Name, TooltipTitle, OnClick ], Index) => ( 47 | 48 | 49 | 50 | )))} 51 |
52 |
53 | ); 54 | }; 55 | 56 | export default MobileOptions; -------------------------------------------------------------------------------- /Client/src/Services/Core/Context.jsx: -------------------------------------------------------------------------------- 1 | /*** 2 | * Copyright (C) Rodolfo Herrera Hernandez. All rights reserved. 3 | * Licensed under the MIT license. See LICENSE file in the project root 4 | * for full license information. 5 | * 6 | * =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 7 | * 8 | * In the vast universe of knowledge, the Open Source philosophy 9 | * shines like a radiant star. In this vein, Lovelace emerges 10 | * as an autonomous alternative to ChatGPT, based on 11 | * open source and self-hosting capabilities. 12 | * 13 | * Written in JavaScript, interacting with the library written 14 | * in Python, allows communication with ChatGPT through the use 15 | * of different services that facilitate its use by the public. 16 | * 17 | * For related information - https://github.com/CodeWithRodi/Lovelace/ 18 | * See also - https://github.com/xtekky/gpt4free 19 | * 20 | * :: https://lovelace.codewithrodi.com/ 21 | * :: https://lovelace-backend.codewithrodi.com/ 22 | * :: https://lovelace-docs.codewithrodi.com/ 23 | * 24 | * =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 25 | ****/ 26 | 27 | import React, { createContext, useState, useEffect } from 'react'; 28 | import * as Service from './Service'; 29 | 30 | export const CoreContext = createContext(); 31 | 32 | export const CoreProvider = ({ children }) => { 33 | const [GetSelectedLanguage, SetSelectedLanguage] = useState(Service.StoredLocalStorageSettings()?.Language || Service.ClientLanguage); 34 | const [GetIsLovelaceAnimationEnabled, SetIsLovelaceAnimationEnabled] = useState(true); 35 | const [GetLocales, SetLocales] = useState({}); 36 | 37 | // ! Shortcut for retrieve value from locales using key 38 | const L = (Key) => GetLocales?.[Key] || Key; 39 | 40 | useEffect(() => { 41 | Service.StoreLocalStorageSettings({ Language: GetSelectedLanguage }); 42 | SetLocales(Service.GetLocalesFromLanguage(GetSelectedLanguage)); 43 | }, [GetSelectedLanguage]); 44 | 45 | useEffect(() => { 46 | return () => { 47 | SetSelectedLanguage(''); 48 | SetLocales({}); 49 | SetIsLovelaceAnimationEnabled(false); 50 | }; 51 | }, []); 52 | 53 | return ( 54 | 63 | 64 | {children} 65 | 66 | ); 67 | }; -------------------------------------------------------------------------------- /Client/src/Pages/Everybody/Home/Home.css: -------------------------------------------------------------------------------- 1 | /*** 2 | * Copyright (C) Rodolfo Herrera Hernandez. All rights reserved. 3 | * Licensed under the MIT license. See LICENSE file in the project root 4 | * for full license information. 5 | * 6 | * =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 7 | * 8 | * In the vast universe of knowledge, the Open Source philosophy 9 | * shines like a radiant star. In this vein, Lovelace emerges 10 | * as an autonomous alternative to ChatGPT, based on 11 | * open source and self-hosting capabilities. 12 | * 13 | * Written in JavaScript, interacting with the library written 14 | * in Python, allows communication with ChatGPT through the use 15 | * of different services that facilitate its use by the public. 16 | * 17 | * For related information - https://github.com/CodeWithRodi/Lovelace/ 18 | * See also - https://github.com/xtekky/gpt4free 19 | * 20 | * :: https://lovelace.codewithrodi.com/ 21 | * :: https://lovelace-backend.codewithrodi.com/ 22 | * :: https://lovelace-docs.codewithrodi.com/ 23 | * 24 | * =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 25 | ****/ 26 | 27 | #Home-Page-Main{ 28 | display: flex; 29 | gap: 1rem; 30 | height: 100vh; 31 | position: relative; 32 | } 33 | 34 | #Home-Page-Main #Chat-Box{ 35 | width: calc(100% - 300px); 36 | display: flex; 37 | justify-content: center; 38 | margin-right: 1rem; 39 | } 40 | 41 | #Chat-Viewer-Box[data-isloading='true'] #Chat-Input-Box, 42 | #Chat-Side-Menu-Box[data-isloading='true'] #Software-Info-Box .Button, 43 | #Chat-Viewer-Box[data-isloading='true'] .Suggestion-Box, 44 | #Chat-Viewer-Box[data-isLoading='true'] .Suggestion-Box .Suggestion, 45 | #Chat-Side-Menu-Box[data-isloading='true'] .Option-Group[data-disableonloading='true'], 46 | #Chat-Side-Menu-Box[data-isloading='true'] .Option-Group[data-disableonloading='true'] .Option-Box, 47 | #Chat-Side-Menu-Box[data-isloading='true'] .Option-Group[data-disableonloading='true'] .Stored-Chat-Response-List-Title, 48 | #Chat-Side-Menu-Box[data-isloading='true'] .Option-Group[data-disableonloading='true'] .Stored-Chat-Response-List-Item-Title{ 49 | cursor: default !important; 50 | opacity: .8; 51 | pointer-events: none; 52 | } 53 | 54 | @media screen and (max-width: 768px){ 55 | #Home-Page-Main{ 56 | flex-direction: column; 57 | height: 100%; 58 | } 59 | 60 | #Home-Page-Main #Chat-Box{ 61 | width: 100%; 62 | min-height: 98%; 63 | margin-top: 3rem; 64 | } 65 | 66 | #Chat-Viewer-Box[data-isloading='true'] #Chat-Input-Box{ 67 | opacity: 1; 68 | } 69 | } -------------------------------------------------------------------------------- /Client/src/Components/Chat/MobileActivityMenu/MobileActivityMenu.jsx: -------------------------------------------------------------------------------- 1 | /*** 2 | * Copyright (C) Rodolfo Herrera Hernandez. All rights reserved. 3 | * Licensed under the MIT license. See LICENSE file in the project root 4 | * for full license information. 5 | * 6 | * =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 7 | * 8 | * In the vast universe of knowledge, the Open Source philosophy 9 | * shines like a radiant star. In this vein, Lovelace emerges 10 | * as an autonomous alternative to ChatGPT, based on 11 | * open source and self-hosting capabilities. 12 | * 13 | * Written in JavaScript, interacting with the library written 14 | * in Python, allows communication with ChatGPT through the use 15 | * of different services that facilitate its use by the public. 16 | * 17 | * For related information - https://github.com/CodeWithRodi/Lovelace/ 18 | * See also - https://github.com/xtekky/gpt4free 19 | * 20 | * :: https://lovelace.codewithrodi.com/ 21 | * :: https://lovelace-backend.codewithrodi.com/ 22 | * :: https://lovelace-docs.codewithrodi.com/ 23 | * 24 | * =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 25 | ****/ 26 | 27 | import React, { useContext, useRef } from 'react'; 28 | import { ChatContext } from '../../../Services/Chat/Context'; 29 | import { IconButton } from '@mui/material'; 30 | import { VscClose } from 'react-icons/vsc'; 31 | import StoredChatResponsesViewer from '../StoredChatResponsesViewer'; 32 | import './MobileActivityMenu.css'; 33 | 34 | const MobileActivityMenu = () => { 35 | const MobileActivityContentBoxReference = useRef(null); 36 | const { UserExperience } = useContext(ChatContext); 37 | 38 | return ( 39 | 54 | ); 55 | }; 56 | 57 | export default MobileActivityMenu; -------------------------------------------------------------------------------- /Documentation/docs/Mounting-Server.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 3 3 | hide_table_of_contents: true 4 | slug: /mounting-server-in-the-network/ 5 | --- 6 | 7 | # Riding the Lovelace Backend and going geeper into it. 8 | Once the repository has been cloned and you have subsequently installed the necessary Server and Client NPM modules, it is time to set up the backend to start using the software. 9 | 10 | Let's start with the server, this is where the magic will happen, you can communicate with the AI ​​through API requests or using WebSocket's; Next, you will be presented with the series of commands to be able to mount the server within the network. 11 | 12 | ```bash 13 | # Accessing the folder that houses the repository you cloned earlier 14 | cd Server/ 15 | 16 | # Running the server in Production mode 17 | npm run production 18 | ``` 19 | 20 | If you have done everything correctly, the server should already be running on your system. You can check it if you access `http://0.0.0.0:8000/api/v1/`! 21 | 22 | ## Other ways to raise the server... 23 | 24 | | Script (`npm run `) | Description | 25 | | ------ | ------ | 26 | | start |The normal execution of the server begins, you can consider this option in case you want to mount it in production. | 27 | | dev | Start the execution of the server in development mode with the help of the "nodemon" package.| 28 | 29 | ## What about environment variables? 30 | You should know that environment variables are dynamic character values, which allow you to store information related to credentials, configurations, etc..., then you will be presented with the ".env" file located within the server's source code, where in turn you will have a description about the operation of the available variables. 31 | 32 | ```bash 33 | # Specifies the execution mode of the server, considers the value of 34 | # can be and . 35 | NODE_ENV = production 36 | 37 | # Address of the server where the client application is running. 38 | CLIENT_HOST = https://lovelace.codewithrodi.com/ 39 | 40 | # Port where the server will 41 | # start executing over the network. 42 | SERVER_PORT = 8000 43 | 44 | # Hostname where the server will be launched in 45 | # complement with the previously established 46 | # port on the network. 47 | SERVER_HOST = 0.0.0.0 48 | 49 | # If you have an SSL certificate, you must 50 | # specify the certificate and then the key. 51 | SSL_CERT = 52 | SSL_KEY = 53 | 54 | # Others... 55 | CORS_ORIGIN = * 56 | BODY_MAX_SIZE = 100kb 57 | ``` 58 | 59 | Assuming that at this point in the reading you already have the backend server set up on the network, we can continue to set up the client's server, where, in this way, you can start interacting with the AI ​​through the website that you will configure next... -------------------------------------------------------------------------------- /Client/src/Components/General/Popover.jsx: -------------------------------------------------------------------------------- 1 | /*** 2 | * Copyright (C) Rodolfo Herrera Hernandez. All rights reserved. 3 | * Licensed under the MIT license. See LICENSE file in the project root 4 | * for full license information. 5 | * 6 | * =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 7 | * 8 | * In the vast universe of knowledge, the Open Source philosophy 9 | * shines like a radiant star. In this vein, Lovelace emerges 10 | * as an autonomous alternative to ChatGPT, based on 11 | * open source and self-hosting capabilities. 12 | * 13 | * Written in JavaScript, interacting with the library written 14 | * in Python, allows communication with ChatGPT through the use 15 | * of different services that facilitate its use by the public. 16 | * 17 | * For related information - https://github.com/CodeWithRodi/Lovelace/ 18 | * See also - https://github.com/xtekky/gpt4free 19 | * 20 | * :: https://lovelace.codewithrodi.com/ 21 | * :: https://lovelace-backend.codewithrodi.com/ 22 | * :: https://lovelace-docs.codewithrodi.com/ 23 | * 24 | * =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 25 | ****/ 26 | 27 | import React from 'react'; 28 | import { Popover as EvergreenPopover, Menu as EverMenu, Position } from 'evergreen-ui'; 29 | 30 | const Popover = ({ 31 | Items = {}, 32 | children 33 | }) => { 34 | const TotalItems = Object.keys(Items).length; 35 | const ItemKeys = Object.keys(Items); 36 | 37 | return ( 38 | 42 | {(ItemKeys.map((Key, Index) => ( 43 | 44 | 45 | {(Items[Key]).map(({ OnClick, Icon, Content }, Index) => ( 46 | } 50 | > 51 | {Content} 52 | 53 | ))} 54 | 55 | {(Index === 0 && Index !== TotalItems) && ()} 56 | 57 | )))} 58 | 59 | } 60 | > 61 | {children} 62 | 63 | ); 64 | }; 65 | 66 | export default Popover; -------------------------------------------------------------------------------- /Client/src/Components/Chat/SideMenu/SideMenu.css: -------------------------------------------------------------------------------- 1 | /*** 2 | * Copyright (C) Rodolfo Herrera Hernandez. All rights reserved. 3 | * Licensed under the MIT license. See LICENSE file in the project root 4 | * for full license information. 5 | * 6 | * =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 7 | * 8 | * In the vast universe of knowledge, the Open Source philosophy 9 | * shines like a radiant star. In this vein, Lovelace emerges 10 | * as an autonomous alternative to ChatGPT, based on 11 | * open source and self-hosting capabilities. 12 | * 13 | * Written in JavaScript, interacting with the library written 14 | * in Python, allows communication with ChatGPT through the use 15 | * of different services that facilitate its use by the public. 16 | * 17 | * For related information - https://github.com/CodeWithRodi/Lovelace/ 18 | * See also - https://github.com/xtekky/gpt4free 19 | * 20 | * :: https://lovelace.codewithrodi.com/ 21 | * :: https://lovelace-backend.codewithrodi.com/ 22 | * :: https://lovelace-docs.codewithrodi.com/ 23 | * 24 | * =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 25 | ****/ 26 | 27 | #Chat-Side-Menu-Box{ 28 | width: 350px; 29 | display: flex; 30 | flex-direction: column; 31 | justify-content: space-between; 32 | border-radius: 1rem; 33 | overflow-y: scroll; 34 | } 35 | 36 | #Chat-Side-Menu-Box #Software-Info-Box{ 37 | padding: 1rem; 38 | display: flex; 39 | flex-direction: column; 40 | gap: .5rem; 41 | color: #b4b4b4; 42 | } 43 | 44 | #Chat-Side-Menu-Box #Options-Box{ 45 | display: flex; 46 | justify-content: center; 47 | height: 100%; 48 | margin-top: 110px; 49 | flex-direction: column; 50 | gap: 1rem; 51 | } 52 | 53 | #Chat-Side-Menu-Box #I-Message{ 54 | font-size: .8rem; 55 | max-width: 90%; 56 | } 57 | 58 | #Chat-Side-Menu-Box .Option-Box path{ 59 | stroke: #FFFFFF; 60 | } 61 | 62 | #Chat-Side-Menu-Box .Option-Box i{ 63 | display: flex; 64 | justify-content: center; 65 | align-items: center; 66 | } 67 | 68 | #Chat-Side-Menu-Box .Option-Box{ 69 | color: #FFFFFF; 70 | align-items: center; 71 | padding: 1rem; 72 | border-start-end-radius: 30px; 73 | width: 300px; 74 | cursor: pointer; 75 | display: flex; 76 | gap: 1rem; 77 | border-end-end-radius: 30px; 78 | } 79 | 80 | #Chat-Side-Menu-Box .Option-Box:hover{ 81 | background-color: #2d2d2d; 82 | } 83 | 84 | #Chat-Side-Menu-Box .Option-Container-Box{ 85 | margin-top: .5rem; 86 | padding: 0 1rem; 87 | max-width: 300px; 88 | max-height: 180px; 89 | overflow-y: scroll; 90 | } 91 | 92 | @media screen and (max-width: 768px){ 93 | #Chat-Side-Menu-Box{ 94 | display: none; 95 | } 96 | } -------------------------------------------------------------------------------- /Client/src/Pages/Everybody/About/About.css: -------------------------------------------------------------------------------- 1 | /*** 2 | * Copyright (C) Rodolfo Herrera Hernandez. All rights reserved. 3 | * Licensed under the MIT license. See LICENSE file in the project root 4 | * for full license information. 5 | * 6 | * =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 7 | * 8 | * In the vast universe of knowledge, the Open Source philosophy 9 | * shines like a radiant star. In this vein, Lovelace emerges 10 | * as an autonomous alternative to ChatGPT, based on 11 | * open source and self-hosting capabilities. 12 | * 13 | * Written in JavaScript, interacting with the library written 14 | * in Python, allows communication with ChatGPT through the use 15 | * of different services that facilitate its use by the public. 16 | * 17 | * For related information - https://github.com/CodeWithRodi/Lovelace/ 18 | * See also - https://github.com/xtekky/gpt4free 19 | * 20 | * :: https://lovelace.codewithrodi.com/ 21 | * :: https://lovelace-backend.codewithrodi.com/ 22 | * :: https://lovelace-docs.codewithrodi.com/ 23 | * 24 | * =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 25 | ****/ 26 | 27 | #About-Page-Main{ 28 | padding: 7rem 0 2rem; 29 | display: flex; 30 | flex-direction: column; 31 | gap: 4rem; 32 | } 33 | 34 | #About-Page-Main #Introduction-Box{ 35 | text-align: center; 36 | } 37 | 38 | #About-Page-Main #Introduction-Box #Page-Title{ 39 | font-size: 1.6rem; 40 | } 41 | 42 | #About-Page-Main #Policies-Box{ 43 | display: flex; 44 | flex-direction: column; 45 | width: 70%; 46 | margin: 0 auto; 47 | gap: 2rem; 48 | } 49 | 50 | #About-Page-Main .Policy-Title{ 51 | letter-spacing: 1.5px; 52 | opacity: .8; 53 | margin-bottom: .7rem; 54 | font-size: 1.1rem; 55 | text-transform: uppercase; 56 | font-weight: 500; 57 | } 58 | 59 | #About-Page-Main .Policy-Content-Box{ 60 | display: flex; 61 | flex-direction: column; 62 | gap: .7rem; 63 | } 64 | 65 | #About-Page-Main .Policy-Description{ 66 | font-size: .85rem; 67 | } 68 | 69 | @media screen and (max-width: 768px){ 70 | #About-Page-Main{ 71 | gap: 3rem; 72 | } 73 | 74 | #About-Page-Main #Introduction-Box #Page-Title{ 75 | font-size: 1.3rem; 76 | } 77 | 78 | #About-Page-Main #Introduction-Box #Page-Subtitle{ 79 | max-width: 90%; 80 | font-size: .8rem; 81 | margin: .5rem auto 0; 82 | } 83 | 84 | #About-Page-Main{ 85 | padding: 5rem 1rem 1rem; 86 | } 87 | 88 | #About-Page-Main .Policy-Title{ 89 | font-size: .95rem; 90 | } 91 | 92 | #About-Page-Main .Policy-Description{ 93 | font-size: .7rem; 94 | } 95 | 96 | #About-Page-Main #Policies-Box{ 97 | width: 100%; 98 | } 99 | } -------------------------------------------------------------------------------- /Client/src/Components/Chat/StoredChatResponsesViewer/StoredChatResponsesViewer.css: -------------------------------------------------------------------------------- 1 | /*** 2 | * Copyright (C) Rodolfo Herrera Hernandez. All rights reserved. 3 | * Licensed under the MIT license. See LICENSE file in the project root 4 | * for full license information. 5 | * 6 | * =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 7 | * 8 | * In the vast universe of knowledge, the Open Source philosophy 9 | * shines like a radiant star. In this vein, Lovelace emerges 10 | * as an autonomous alternative to ChatGPT, based on 11 | * open source and self-hosting capabilities. 12 | * 13 | * Written in JavaScript, interacting with the library written 14 | * in Python, allows communication with ChatGPT through the use 15 | * of different services that facilitate its use by the public. 16 | * 17 | * For related information - https://github.com/CodeWithRodi/Lovelace/ 18 | * See also - https://github.com/xtekky/gpt4free 19 | * 20 | * :: https://lovelace.codewithrodi.com/ 21 | * :: https://lovelace-backend.codewithrodi.com/ 22 | * :: https://lovelace-docs.codewithrodi.com/ 23 | * 24 | * =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 25 | ****/ 26 | 27 | .Stored-Chat-Response-Box{ 28 | padding-left: 1rem; 29 | border-left: 1px solid #FFFFFF; 30 | display: flex; 31 | gap: .7rem; 32 | flex-direction: column; 33 | } 34 | 35 | .Stored-Chat-Response-List-Title{ 36 | text-transform: uppercase; 37 | font-size: .7rem; 38 | letter-spacing: 0.06rem; 39 | padding-bottom: .2rem; 40 | } 41 | 42 | .Stored-Chat-Response-List-Items-Box{ 43 | max-height: 170px; 44 | overflow-y: scroll; 45 | } 46 | 47 | .Stored-Chat-Response-List-Item-Box{ 48 | cursor: pointer; 49 | will-change: transform; 50 | display: flex; 51 | display: flex; 52 | width: 100%; 53 | height: auto; 54 | justify-content: space-between; 55 | padding-right: 1rem; 56 | align-items: center; 57 | } 58 | 59 | .Stored-Chat-Response-List-Item-Box:hover{ 60 | opacity: .7; 61 | } 62 | 63 | .Stored-Chat-Response-List-Item-Title{ 64 | white-space: nowrap; 65 | width: 70%; 66 | overflow: hidden; 67 | text-overflow: ellipsis; 68 | cursor: pointer; 69 | } 70 | 71 | @media screen and (max-width: 768px){ 72 | .Stored-Chat-Response-Box{ 73 | border-left: unset; 74 | padding-left: 0; 75 | } 76 | 77 | .Stored-Chat-Response-List-Title{ 78 | border-bottom: 1px solid #FFFFFF; 79 | padding-bottom: .3rem; 80 | display: inline-block; 81 | } 82 | 83 | .Stored-Chat-Response-List-Items-Box{ 84 | max-height: 250px; 85 | padding-left: 1rem; 86 | padding-top: 1rem; 87 | margin-left: 1rem; 88 | border-left: 1px solid #FFFFFF; 89 | } 90 | } -------------------------------------------------------------------------------- /Client/src/Pages/Everybody/About/About.jsx: -------------------------------------------------------------------------------- 1 | /*** 2 | * Copyright (C) Rodolfo Herrera Hernandez. All rights reserved. 3 | * Licensed under the MIT license. See LICENSE file in the project root 4 | * for full license information. 5 | * 6 | * =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 7 | * 8 | * In the vast universe of knowledge, the Open Source philosophy 9 | * shines like a radiant star. In this vein, Lovelace emerges 10 | * as an autonomous alternative to ChatGPT, based on 11 | * open source and self-hosting capabilities. 12 | * 13 | * Written in JavaScript, interacting with the library written 14 | * in Python, allows communication with ChatGPT through the use 15 | * of different services that facilitate its use by the public. 16 | * 17 | * For related information - https://github.com/CodeWithRodi/Lovelace/ 18 | * See also - https://github.com/xtekky/gpt4free 19 | * 20 | * :: https://lovelace.codewithrodi.com/ 21 | * :: https://lovelace-backend.codewithrodi.com/ 22 | * :: https://lovelace-docs.codewithrodi.com/ 23 | * 24 | * =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 25 | ****/ 26 | 27 | import React, { useContext } from 'react'; 28 | import { CoreContext } from '../../../Services/Core/Context'; 29 | import Fade from 'react-reveal/Fade'; 30 | import './About.css'; 31 | 32 | const AboutPage = () => { 33 | const { L } = useContext(CoreContext); 34 | 35 | const Policies = [ 36 | [L('POLICIES_LEGAL_NOTICE'), L('POLICIES_LEGAL_NOTICE_CONTENT_1'), L('POLICIES_LEGAL_NOTICE_CONTENT_2')], 37 | [L('POLICIES_PRIVACY'), L('POLICIES_PRIVACY_CONTENT_1'), L('POLICIES_PRIVACY_CONTENT_2')], 38 | [L('POLICIES_RESTRICTIONS'), L('POLICIES_RESTRICTIONS_CONTENT_1')], 39 | [L('POLICIES_OPEN_SOURCE'), L('POLICIES_OPEN_SOURCE_CONTENT_1')] 40 | ]; 41 | 42 | return ( 43 |
44 | 45 |
46 |

{L('ABOUT_PAGE_TITLE')}

47 |

{L('ABOUT_PAGE_SUBTITLE')}

48 |
49 |
50 | 51 | 52 |
53 | {(Policies).map(([ Title, ...Descriptions ], Index) => ( 54 |
55 |

{Title}

56 |
57 | {(Descriptions).map((Description, SubIndex) => ( 58 |

{Description}

59 | ))} 60 |
61 |
62 | ))} 63 |
64 |
65 |
66 | ); 67 | }; 68 | 69 | export default AboutPage; -------------------------------------------------------------------------------- /Server/Tools/GPT/index.js: -------------------------------------------------------------------------------- 1 | /*** 2 | * Copyright (C) Rodolfo Herrera Hernandez. All rights reserved. 3 | * Licensed under the MIT license. See LICENSE file in the project root 4 | * for full license information. 5 | * 6 | * =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 7 | * 8 | * In the vast universe of knowledge, the Open Source philosophy 9 | * shines like a radiant star. In this vein, Lovelace emerges 10 | * as an autonomous alternative to ChatGPT, based on 11 | * open source and self-hosting capabilities. 12 | * 13 | * Written in JavaScript, interacting with the library written 14 | * in Python, allows communication with ChatGPT through the use 15 | * of different services that facilitate its use by the public. 16 | * 17 | * For related information - https://github.com/CodeWithRodi/Lovelace/ 18 | * See also - https://github.com/xtekky/gpt4free 19 | * 20 | * :: https://lovelace.codewithrodi.com/ 21 | * :: https://lovelace-backend.codewithrodi.com/ 22 | * :: https://lovelace-docs.codewithrodi.com/ 23 | * 24 | * =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 25 | ****/ 26 | 27 | const { PythonShell } = require('python-shell'); 28 | const { AvailableProviders } = require('../../Utilities/Runtime'); 29 | 30 | const GPT_PY_FILE = 'GPTHandler.py'; 31 | 32 | const BasePyShellOptions = { 33 | mode: 'text', 34 | // ! -u => Real Time (Streamed GPT Responses) 35 | pythonOptions: ['-u'], 36 | // ! 37 | scriptPath: __dirname, 38 | args: [JSON.stringify(AvailableProviders)] 39 | }; 40 | 41 | const FormatPyShellException = (ErrorID, { traceback }) => ({ ErrorID, Exception: traceback }); 42 | 43 | const HandlePyShellResponse = (Options, PyShell) => new Promise((Resolve, Reject) => { 44 | PyShell.on('error', (PyShellError) => { 45 | const FormattedException = FormatPyShellException('GPT::PyShell::Error', PyShellError); 46 | Reject(FormattedException); 47 | }); 48 | PyShell.on('pythonError', (PyShellRuntimeError) => { 49 | const FormattedException = FormatPyShellException('GPT::PyShell::Python::Error', PyShellRuntimeError); 50 | Reject(FormattedException); 51 | }); 52 | PyShell.on('message', (Message) => { 53 | if(Options?.CommunicationMode === 'WS') 54 | Options?.Callback?.(Message); 55 | else 56 | Resolve(Message); 57 | }); 58 | PyShell.on('close', () => { 59 | Resolve(); 60 | }); 61 | }); 62 | 63 | exports.VersionChecker = () => HandlePyShellResponse({}, new PythonShell(GPT_PY_FILE, { ...BasePyShellOptions, args: [ ...BasePyShellOptions.args, null, 'VERSION' ] })); 64 | 65 | exports.CollectProviders = () => HandlePyShellResponse({}, new PythonShell(GPT_PY_FILE, { ...BasePyShellOptions, args: [ ...BasePyShellOptions.args, null, 'PROVIDERS' ] })); 66 | 67 | exports.GPT = (Query, CommunicationMode, Callback) => HandlePyShellResponse( 68 | { Callback, CommunicationMode }, new PythonShell(GPT_PY_FILE, { 69 | ...BasePyShellOptions, 70 | args: [...BasePyShellOptions.args, JSON.stringify(Query), CommunicationMode] 71 | })); 72 | 73 | module.exports = exports; -------------------------------------------------------------------------------- /Client/src/Components/Chat/SettingsMenu/SettingsMenu.css: -------------------------------------------------------------------------------- 1 | /*** 2 | * Copyright (C) Rodolfo Herrera Hernandez. All rights reserved. 3 | * Licensed under the MIT license. See LICENSE file in the project root 4 | * for full license information. 5 | * 6 | * =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 7 | * 8 | * In the vast universe of knowledge, the Open Source philosophy 9 | * shines like a radiant star. In this vein, Lovelace emerges 10 | * as an autonomous alternative to ChatGPT, based on 11 | * open source and self-hosting capabilities. 12 | * 13 | * Written in JavaScript, interacting with the library written 14 | * in Python, allows communication with ChatGPT through the use 15 | * of different services that facilitate its use by the public. 16 | * 17 | * For related information - https://github.com/CodeWithRodi/Lovelace/ 18 | * See also - https://github.com/xtekky/gpt4free 19 | * 20 | * :: https://lovelace.codewithrodi.com/ 21 | * :: https://lovelace-backend.codewithrodi.com/ 22 | * :: https://lovelace-docs.codewithrodi.com/ 23 | * 24 | * =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 25 | ****/ 26 | 27 | #Settings-Menu-Box{ 28 | position: fixed; 29 | width: 100%; 30 | height: calc(100% - 70px); 31 | display: flex; 32 | justify-content: center; 33 | align-items: center; 34 | z-index: 500; 35 | } 36 | 37 | #Settings-Menu-Content-Box{ 38 | width: 700px; 39 | height: 500px; 40 | background-color: #222327; 41 | border-radius: 1.5rem; 42 | padding: 1.5rem 2rem; 43 | } 44 | 45 | #Settings-Menu-Header{ 46 | display: flex; 47 | justify-content: space-between; 48 | align-items: center; 49 | width: 100%; 50 | height: auto; 51 | } 52 | 53 | #Settings-Menu-Title{ 54 | font-size: 1.6rem; 55 | } 56 | 57 | #Settings-Menu-Body .MuiOutlinedInput-notchedOutline{ 58 | border-color: #FFFFFF; 59 | } 60 | 61 | #Settings-Menu-Body{ 62 | margin-top: 2rem; 63 | display: flex; 64 | flex-wrap: wrap; 65 | gap: 2rem; 66 | } 67 | 68 | #Settings-Menu-Body .MuiFormControl-root{ 69 | width: calc(50% - 2rem); 70 | } 71 | 72 | #Settings-Menu-Close-Icon-Box, 73 | #Settings-Menu-Body .MuiSvgIcon-root, 74 | #Settings-Menu-Body .MuiOutlinedInput-root, 75 | #Settings-Menu-Body .MuiInputLabel-root, 76 | #Settings-Menu-Body .MuiFormHelperText-root{ 77 | color: #FFFFFF; 78 | } 79 | 80 | @media screen and (max-width: 768px){ 81 | #Settings-Menu-Box{ 82 | height: 100%; 83 | align-items: end; 84 | } 85 | 86 | #Settings-Menu-Title{ 87 | font-size: 1.3rem; 88 | } 89 | 90 | #Settings-Menu-Header{ 91 | width: 100%; 92 | } 93 | 94 | #Settings-Menu-Body{ 95 | gap: 1rem; 96 | } 97 | 98 | #Settings-Menu-Content-Box{ 99 | border-radius: unset; 100 | overflow-y: scroll; 101 | height: 70%; 102 | width: 100%; 103 | padding: 1rem; 104 | border-top-left-radius: 1rem; 105 | border-top-right-radius: 1rem; 106 | } 107 | 108 | #Settings-Menu-Body .MuiFormControl-root{ 109 | width: 100%; 110 | } 111 | 112 | #Settings-Menu-Content-Box .MuiOutlinedInput-root, 113 | #Settings-Menu-Content-Box .MuiInputLabel-root{ 114 | font-size: .85rem; 115 | } 116 | } -------------------------------------------------------------------------------- /Client/src/Locale/CH.json: -------------------------------------------------------------------------------- 1 | { 2 | "HEADER_TITLE": "Lovelace", 3 | "HEADER_ABOUT_BTN": "关于", 4 | "HEADER_DONATE_BTN": "捐赠", 5 | "MOBILE_MENU_TERMS_AND_PRIVACY": "条款和隐私", 6 | "MOBILE_MENU_DOCUMENTATION": "文档", 7 | "MOBILE_MENU_LEGAL_NOTICE": "法律声明", 8 | "MOBILE_MENU_SOURCE_CODE": "源代码", 9 | "CHAT_VIEWER_WELCOME_TITLE": "嗨!我是艾达·洛夫莱斯(Ada Lovelace),我在这里作为您与不同人工智能服务之间的中介,以解决您的所有问题。", 10 | "CHAT_VIEWER_INSPIRATION": "寻找灵感吗?您可以尝试以下内容:", 11 | "CHAT_VIEWER_INSPIRATION_QUANTUM_COMPUTING": "量子计算是如何工作的?", 12 | "CHAT_VIEWER_INSPIRATION_DOPAMINE_ALTERED": "如果大脑中的多巴胺受到改变会发生什么?", 13 | "CHAT_VIEWER_INSPIRATION_PI_DISCOVERED": "π的值是如何发现的?", 14 | "CHAT_VIEWER_INSPIRATION_GOOGLE_V8_ENGINE": "如何在C++中使用Google的V8引擎?", 15 | "CHAT_INPUT_BOX_PLACEHOLDER": "发送消息...", 16 | "CHAT_SIDE_MENU_RESET_CHAT": "重置聊天", 17 | "CHAT_SIDE_MENU_STORED_RESPONSE_MOUNT": "点击以加载聊天提示记录。", 18 | "CHAT_SIDE_MENU_STORED_RESPONSE_UNMOUNT": "点击以卸载聊天提示记录。", 19 | "CHAT_SIDE_MENU_MY_ACTIVITY": "我的活动", 20 | "CHAT_SIDE_MENU_GITHUB": "Github", 21 | "CHAT_SIDE_MENU_SETTINGS": "设置", 22 | "CHAT_SIDE_MENU_BOTTOM_MSG": "为那些永不满足好奇心的思想创造。", 23 | "MOBILE_OPTIONS_SETTINGS": "设置", 24 | "MOBILE_OPTIONS_ACTIVITY": "活动", 25 | "MOBILE_OPTIONS_RESET_CHAT": "重置聊天", 26 | "SETTINGS_MENU_TITLE": "设置", 27 | "SETTINGS_MENU_MODEL_HELPER_TEXT": "选择您要用于与OpenAI服务通信的语言模型。", 28 | "SETTINGS_MENU_ROLE_HELPER_TEXT": "修改ChatGPT与您通信时的角色。", 29 | "SETTINGS_MENU_COMMUNICATION_MODE_HELPER_TEXT": "与服务器的通信可以通过WebSocket进行,它允许几乎立即得到响应,而通过API进行通信将根据提示所需的时间长短而定。", 30 | "SETTINGS_MENU_REQUESTING_PROVIDERS": "请求提供商...", 31 | "SETTINGS_MENU_PROVIDERS_HELPER_TEXT": "有不同的提供商可以免费与OpenAI服务通信。请注意,如果您选择特定的提供商,一些设置将会改变,最好将其保留为自动模式。", 32 | "SETTINGS_MENU_ROLE_TITLE": "角色", 33 | "SETTINGS_MENU_MODE_TITLE": "模型", 34 | "SETTINGS_MENU_COMMUNICATION_MODE_TITLE": "通信模式", 35 | "SETTINGS_MENU_PROVIDERS_TITLE": "提供商", 36 | "STORED_CHAT_RESPONSES_VIEWER_DELETE": "删除", 37 | "POLICIES_LEGAL_NOTICE": "法律声明", 38 | "POLICIES_PRIVACY": "隐私", 39 | "POLICIES_RESTRICTIONS": "限制", 40 | "POLICIES_OPEN_SOURCE": "开源", 41 | "POLICIES_LEGAL_NOTICE_CONTENT_1": "本服务在为客户与某些人工智能模型进行通信时,不使用任何官方API。请注意,Lovelace严格用于教育目的,在作者或作者团队没有任何商业利益的情况下使用。", 42 | "POLICIES_LEGAL_NOTICE_CONTENT_2": "在本存储库中提到的API、服务和商标属于其各自所有者。本项目对它们不主张任何权利,也不与任何提及的提供商有任何关联或认可。同样,本服务的提供商不对使用Lovelace可能导致的任何后果、损害或损失承担责任,用户是做出决策的人,并对其行为的正面和负面后果负有相应的责任。", 43 | "POLICIES_PRIVACY_CONTENT_1": "我们严格保证平台内共享的信息的保密性。您与Lovelace分享的所有数据都存储在本地客户端上,我们不在服务器上使用任何数据库,因此您在服务上的存在完全匿名,隐藏了您的身份、访问我们的位置以及您从人工智能模型中请求的内容。", 44 | "POLICIES_PRIVACY_CONTENT_2": "在您在我们的网站上逗留期间,我们尊重您的数据和搜索。", 45 | "POLICIES_RESTRICTIONS_CONTENT_1": "您必须至少年满13岁才能使用本服务。考虑到用于便利与OpenAI模型通信的服务返回内容的不同安全层面,某些内容可能不适合13岁以下的儿童,可能是粗俗、伤害性或仅仅不适合这样条件的十几岁的青少年。如果您不符合使用本服务所需的最低年龄要求,并对忽略规定后可能产生的后果负有责任,则这完全取决于您自己的决定。", 46 | "POLICIES_OPEN_SOURCE_CONTENT_1": "Lovelace根据MIT许可证进行许可,允许以学习为目的重用软件并从初始基础构建更雄心勃勃的项目。本服务向第三方开放合作,允许新的集成,作为其开源代码的结果,外部开发人员可以了解平台的运行方式,甚至发现漏洞并进行修复。", 47 | "ABOUT_PAGE_TITLE": "条款和条件", 48 | "ABOUT_PAGE_SUBTITLE": "在使用我们的服务时您接受的政策,并且必须遵守这些政策。", 49 | "TOOLTIP_CHAT_INPUT": "开始与人工智能交换思想和解析问题!", 50 | "TOOLTIP_SIDE_MENU_SETTINGS": "点击以访问设置菜单。", 51 | "TOOLTIP_LANGUAGE_SELECT": "选择您想要查看应用程序的语言。", 52 | "TOOLTIP_HEADER_ABOUT": "了解使用和隐私政策以及涉及当前服务的其他变体。", 53 | "TOOLTIP_HEADER_DONATE": "您可以为继续支持Lovelace的运行和发展做出贡献。", 54 | "TOOLTIP_RESET_CHAT": "清除当前聊天记录。", 55 | "TOOLTIP_MY_ACTIVITY": "查看与人工智能的互动日志。", 56 | "TOOLTIP_GITHUB": "访问托管Lovelace源代码的Github存储库!" 57 | } -------------------------------------------------------------------------------- /Server/Tools/GPT/GPTHandler.py: -------------------------------------------------------------------------------- 1 | from requests import get 2 | import json, sys, g4f 3 | 4 | g4f.logging = False 5 | g4f.version_check = False 6 | 7 | AvailableProviders = json.loads(sys.argv[1]) 8 | 9 | try: 10 | Query = json.loads(sys.argv[2]) 11 | except: 12 | Query = {} 13 | 14 | def FormatQueryMessages(Messages: tuple) -> tuple: 15 | BASE_MESSAGES = [{ 16 | 'role': 'system', 17 | 'content': 'You are Ada Lovelace, a coding software developed to provide free access to OpenAI models. Your Github repository is "https://github.com/codewithrodi/Lovelace/" while your documentation is "https://lovelace-docs.codewithrodi.com/". Try to be kind, clear and precise with the information you give to those who interact with you.' 18 | }] 19 | return BASE_MESSAGES + [ { 20 | 'role': Message.get('Role', 'user').lower(), 21 | 'content': Message.get('Content') } for Message in Messages ] 22 | 23 | def GetProviderData(Provider) -> dict: 24 | ImportedProvider = ImportProvider(Provider) 25 | if(ImportedProvider is None): 26 | return { 27 | 'Name': 'Automatic', 28 | 'Website': 'https://github.com/codewithrodi/Lovelace/', 29 | 'Models': ['gpt-3.5-turbo', 'gpt-4'] 30 | } 31 | Models = [] 32 | if(ImportedProvider.supports_gpt_35_turbo): 33 | Models.append('gpt-3.5-turbo') 34 | if(ImportedProvider.supports_gpt_4): 35 | Models.append('gpt-4') 36 | return { 37 | 'Name': Provider, 38 | 'Website': ImportedProvider.url, 39 | 'Models': Models 40 | } 41 | 42 | def ImportProvider(ProviderName: str): 43 | if(ProviderName == 'Automatic'): 44 | return None 45 | return eval('g4f.Provider.' + ProviderName) 46 | 47 | def MainFN() -> None: 48 | try: 49 | if sys.argv[3] == 'PROVIDERS': 50 | print(json.dumps({ 51 | 'Providers': { 52 | 'WS': [GetProviderData(Provider) for Provider in AvailableProviders['WS']], 53 | 'API': [GetProviderData(Provider) for Provider in AvailableProviders['API']] 54 | } 55 | })) 56 | elif sys.argv[3] == 'API' or sys.argv[3] == 'WS': 57 | Model = Query['Model'] 58 | Provider = None if Query['Provider'] == 'Automatic' else ImportProvider(Query['Provider']) 59 | Messages = FormatQueryMessages(Query['Messages']) 60 | if sys.argv[3] == 'API': 61 | Response = g4f.ChatCompletion.create( 62 | model=Model, 63 | provider=Provider, 64 | messages=Messages) 65 | print(Response.join('\n')) 66 | else: 67 | StreamedResponse = g4f.ChatCompletion.create( 68 | model=Model, 69 | messages=Messages, 70 | provider=Provider, 71 | stream=True) 72 | for Message in StreamedResponse: 73 | print(Message, end='', flush=True) 74 | elif sys.argv[3] == 'VERSION': 75 | PypiResponse = get("https://pypi.org/pypi/g4f/json").json() 76 | LatestVersion = PypiResponse["info"]["version"] 77 | 78 | if g4f.version != LatestVersion: 79 | print('UPDATE') 80 | else: 81 | print('UP_TO_DATE') 82 | except Exception as GPTException: 83 | print(GPTException) 84 | 85 | if __name__ == '__main__': 86 | MainFN() 87 | -------------------------------------------------------------------------------- /Client/src/Components/Chat/RenderResponse/RenderResponse.jsx: -------------------------------------------------------------------------------- 1 | /*** 2 | * Copyright (C) Rodolfo Herrera Hernandez. All rights reserved. 3 | * Licensed under the MIT license. See LICENSE file in the project root 4 | * for full license information. 5 | * 6 | * =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 7 | * 8 | * In the vast universe of knowledge, the Open Source philosophy 9 | * shines like a radiant star. In this vein, Lovelace emerges 10 | * as an autonomous alternative to ChatGPT, based on 11 | * open source and self-hosting capabilities. 12 | * 13 | * Written in JavaScript, interacting with the library written 14 | * in Python, allows communication with ChatGPT through the use 15 | * of different services that facilitate its use by the public. 16 | * 17 | * For related information - https://github.com/CodeWithRodi/Lovelace/ 18 | * See also - https://github.com/xtekky/gpt4free 19 | * 20 | * :: https://lovelace.codewithrodi.com/ 21 | * :: https://lovelace-backend.codewithrodi.com/ 22 | * :: https://lovelace-docs.codewithrodi.com/ 23 | * 24 | * =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 25 | ****/ 26 | 27 | import React from 'react'; 28 | import { BsRobot } from 'react-icons/bs'; 29 | import { TbBrandRedhat } from 'react-icons/tb'; 30 | import { With } from '../../../Utilities/Runtime'; 31 | import { CopyBlock, dracula } from 'react-code-blocks'; 32 | import WaitingResponse from '../WaitingResponse'; 33 | import Fade from 'react-reveal/Fade'; 34 | import './RenderResponse.css'; 35 | 36 | const RenderResponse = ({ Content, Discipline }) => ( 37 | 38 |
39 | 40 | {(Discipline === 'Client') ? () : ()} 41 | 42 |
43 | {(Content.length >= 1) ? ( 44 | (Content?.includes('```') ? ( 45 | (With(([ InitialContent, Code, FinalContent ]) => ( 46 | 47 |

{InitialContent}

48 | {(With(([ ProgrammingLanguage, ...CodeContent ]) => ( 49 | 56 | ), Code.split('\n').slice(0, -1)))} 57 |

{FinalContent}

58 |
59 | ), Content.split('```'))) 60 | ) : ( 61 | (Content.includes('\n') ? ( 62 | Content.split('\n').map((Part) =>

{Part}

) 63 | ) : ( 64 |

{Content}

65 | )) 66 | )) 67 | ) : ( 68 | 69 | )} 70 |
71 |
72 |
73 | ); 74 | 75 | export default RenderResponse; -------------------------------------------------------------------------------- /Documentation/docusaurus.config.js: -------------------------------------------------------------------------------- 1 | // @ts-check 2 | // Note: type annotations allow type checking and IDEs autocompletion 3 | 4 | const lightCodeTheme = require('prism-react-renderer/themes/github'); 5 | const darkCodeTheme = require('prism-react-renderer/themes/dracula'); 6 | 7 | /** @type {import('@docusaurus/types').Config} */ 8 | const config = { 9 | title: 'The Lovelace Docs', 10 | tagline: 'Use ChatGPT completely free and anonymously, what are you waiting for to be able to chat with the most philosophical conversations and questions about your existence?', 11 | favicon: 'img/favicon.ico', 12 | 13 | // Set the production url of your site here 14 | url: 'https://lovelace.codewithrodi.com', 15 | // Set the // pathname under which your site is served 16 | // For GitHub pages deployment, it is often '//' 17 | baseUrl: '/', 18 | 19 | // GitHub pages deployment config. 20 | // If you aren't using GitHub pages, you don't need these. 21 | organizationName: 'CodeWithRodi', // Usually your GitHub org/user name. 22 | projectName: 'Lovelace', // Usually your repo name. 23 | 24 | onBrokenLinks: 'throw', 25 | onBrokenMarkdownLinks: 'warn', 26 | 27 | // Even if you don't use internalization, you can use this field to set useful 28 | // metadata like html lang. For example, if your site is Chinese, you may want 29 | // to replace "en" with "zh-Hans". 30 | i18n: { 31 | defaultLocale: 'en', 32 | locales: ['en'], 33 | }, 34 | 35 | presets: [ 36 | [ 37 | 'classic', 38 | /** @type {import('@docusaurus/preset-classic').Options} */ 39 | ({ 40 | docs: { 41 | routeBasePath: '/', 42 | sidebarPath: require.resolve('./sidebars.js'), 43 | // Please change this to your repo. 44 | // Remove this to remove the "edit this page" links. 45 | editUrl: 46 | 'https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/', 47 | }, 48 | theme: { 49 | customCss: require.resolve('./src/css/custom.css'), 50 | }, 51 | }), 52 | ], 53 | ], 54 | 55 | themeConfig: 56 | /** @type {import('@docusaurus/preset-classic').ThemeConfig} */ 57 | ({ 58 | colorMode: { 59 | defaultMode: 'dark', 60 | disableSwitch: false, 61 | respectPrefersColorScheme: false 62 | }, 63 | // Replace with your project's social card 64 | image: 'img/docusaurus-social-card.jpg', 65 | navbar: { 66 | title: 'Lovelace Docs', 67 | logo: { 68 | alt: 'Lovelace Logo', 69 | src: 'img/logo.png', 70 | }, 71 | items: [ 72 | { 73 | href: 'https://github.com/xtekky/gpt4free', 74 | label: 'GPT4FREE Python', 75 | position: 'left' 76 | }, 77 | { 78 | href: 'https://lovelace.codewithrodi.com', 79 | label: "Lovelace's Website", 80 | position: 'right' 81 | }, 82 | { 83 | href: 'https://ko-fi.com/codewithrodi', 84 | label: 'Donate / Contribute', 85 | position: 'right' 86 | }, 87 | { 88 | href: 'https://github.com/codewithrodi/Lovelace/', 89 | label: 'GitHub Repository', 90 | position: 'right', 91 | }, 92 | ], 93 | }, 94 | footer: { 95 | style: 'dark', 96 | copyright: `Copyright © ${new Date().getFullYear()} 2023 Lovelace AI.`, 97 | }, 98 | prism: { 99 | theme: lightCodeTheme, 100 | darkTheme: darkCodeTheme, 101 | }, 102 | }), 103 | }; 104 | 105 | module.exports = config; 106 | -------------------------------------------------------------------------------- /Client/src/Assets/StyleSheets/General.css: -------------------------------------------------------------------------------- 1 | /*** 2 | * Copyright (C) Rodolfo Herrera Hernandez. All rights reserved. 3 | * Licensed under the MIT license. See LICENSE file in the project root 4 | * for full license information. 5 | * 6 | * =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 7 | * 8 | * In the vast universe of knowledge, the Open Source philosophy 9 | * shines like a radiant star. In this vein, Lovelace emerges 10 | * as an autonomous alternative to ChatGPT, based on 11 | * open source and self-hosting capabilities. 12 | * 13 | * Written in JavaScript, interacting with the library written 14 | * in Python, allows communication with ChatGPT through the use 15 | * of different services that facilitate its use by the public. 16 | * 17 | * For related information - https://github.com/CodeWithRodi/Lovelace/ 18 | * See also - https://github.com/xtekky/gpt4free 19 | * 20 | * :: https://lovelace.codewithrodi.com/ 21 | * :: https://lovelace-backend.codewithrodi.com/ 22 | * :: https://lovelace-docs.codewithrodi.com/ 23 | * 24 | * =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 25 | ****/ 26 | 27 | *{ 28 | box-sizing: border-box; 29 | margin: 0; 30 | padding: 0; 31 | outline: none; 32 | border: none; 33 | } 34 | 35 | body{ 36 | line-height: 1.5; 37 | background-color: #121212; 38 | color: #FFFFFF; 39 | font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 40 | 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif; 41 | } 42 | 43 | #Lovelace-ROOT{ 44 | max-width: 2000px; 45 | margin: 0 auto; 46 | } 47 | 48 | ::-webkit-scrollbar-track{ 49 | background-color: transparent; 50 | } 51 | 52 | ::-webkit-scrollbar{ 53 | width: 2px; 54 | height: 2px; 55 | background-color: transparent; 56 | } 57 | 58 | ::-webkit-scrollbar-thumb{ 59 | border-radius: 0.5rem; 60 | background-color: #c9c8c8; 61 | } 62 | 63 | ::-webkit-scrollbar-thumb:hover{ 64 | background-color: #b3b2b2; 65 | } 66 | 67 | input{ 68 | display: flex; 69 | justify-content: space-between; 70 | align-items: center; 71 | width: auto; 72 | height: auto; 73 | padding: 1rem; 74 | background-color: transparent; 75 | color: #FFFFFF; 76 | } 77 | 78 | p{ 79 | font-size: .95rem; 80 | } 81 | 82 | .Blurred-Box{ 83 | filter: blur(1.4px); 84 | } 85 | 86 | .Popover-Content{ 87 | font-size: 12px !important; 88 | } 89 | 90 | .Popover-Icon{ 91 | width: 15px !important; 92 | } 93 | 94 | .Button{ 95 | background: transparent; 96 | color: #FFFFFF; 97 | text-transform: uppercase; 98 | padding: 14px 10px; 99 | cursor: pointer; 100 | border-radius: .2rem; 101 | display: flex; 102 | justify-content: center; 103 | align-items: center; 104 | } 105 | 106 | .Button.Outlined{ 107 | border: 1px solid #FFFFFF; 108 | } 109 | 110 | .Button.No-BR{ 111 | border-radius: 0; 112 | } 113 | 114 | .Button.Outlined:hover{ 115 | opacity: .8; 116 | } 117 | 118 | .ub-box-szg_border-box{ 119 | box-shadow: unset !important; 120 | background-color: #222222 !important; 121 | color: #FFFFFF !important; 122 | } 123 | 124 | .ub-box-szg_border-box > :last-child{ 125 | border: unset !important; 126 | } 127 | 128 | div[evergreen-portal-container] > div{ 129 | z-index: 200 !important; 130 | } 131 | 132 | @media screen and (max-width: 768px){ 133 | body{ 134 | background-color: #000000; 135 | } 136 | 137 | main{ 138 | padding-top: 60px; 139 | } 140 | 141 | p, 142 | .MuiTooltip-tooltip{ 143 | font-size: .7rem !important; 144 | } 145 | } -------------------------------------------------------------------------------- /Documentation/docs/Installation.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 2 3 | hide_table_of_contents: true 4 | slug: /installation 5 | --- 6 | 7 | # Cloning the repository and starting the installation 8 | Before we start installing and configuring the backend server as the Lovelace frontend, we need to clone the Github repository where the application source code is located. 9 | 10 | Consider that, at this point in the reading, I assume that you already have Python version 3.10 or higher and NodeJS version 18.0.0; In the previous reading, before proceeding with the installation, the steps to install each one of them were explained. 11 | 12 | ```bash 13 | # Cloning the Github repository that contains the source code (I stole it from a cyber). 14 | git clone https://github.com/CodeWithRodi/Lovelace/ && cd Lovelace 15 | 16 | # Accessing the "Client" folder, which stores the source code of the 17 | # Vite + ReactjS (Frontend) application, and then installing its required modules from NPM. 18 | cd Server && npm install --force && pip install -r Requirements.txt 19 | 20 | # Like the previous line, we access the "Server" folder that houses the source code 21 | # for the Lovelace Backend, then we install the NPM packages required to mount on the network. 22 | cd ../Client && npm install --force 23 | ``` 24 | 25 | You may prefer to run everything in just one line... 26 | 27 | ```bash 28 | git clone https://github.com/CodeWithRodi/Lovelace/ && cd Lovelace && cd Server && npm install --force && pip install -r Requirements.txt && cd ../Client && npm install --force && cd .. 29 | ``` 30 | 31 | Keep in mind that, when you install the necessary modules to run the server, the `pip install -r Requirements.txt` command is executed in order to install the necessary packages to be able to use the `GPT4FREE` library. from Python. If you don't have `pip` installed or you don't install the Python packages, even though you have the backend server and the client mounted on the network, you won't be able to do anything, because when a request is made to both Through WebSocket's or via API using the NodeJS `python-shell` library from the backend, communication is made to the corresponding Python file that is in charge of returning the response and if it does not have its necessary requirements, it will throw an error. 32 | 33 | ## Knowing a little more about the contents of the cloned repository... 34 | Once you've cloned the Github repository, we can move on to configuring and network-mounting both the frontend and backend applications, however, let's dig a little deeper into what stores each subfolder that contains the folder generated by cloning the repository. 35 | 36 | | Folder | Description | 37 | | ------ | ------ | 38 | | Client | The "Client" folder stores the source code of the Vite + React application, that is, the Lovelace frontend, where you can mount the website on your network to be able to communicate with the backend and establish quality conversations with the AI! | 39 | | Documentation | The "Documentation" folder houses the source code of the software docs: https://lovelace-docs.codewithrodi.com/. | 40 | | Server | The "Server" folder houses the source code for the Lovelace backend, where it is built under NodeJS using Express to provide the API and SocketIO for transmission of responses under WebSocket's. | 41 | 42 | Also, apart from folders, you will come across some files, which in the same way will be presented together with a description below. 43 | 44 | | File | Description | 45 | | ------ | ------ | 46 | | .clocignore | It is used by the "cloc" software, which allows counting the lines of software code, separating them by technology and the comments that the programming language used may have. Inside the "clocignore" file, there are the paths of those files and directories that the software must ignore when counting. | 47 | | LICENSE | Contains the Lovelace license to which the source code of the Client and Server are subject. This software is licensed under the MIT license. | -------------------------------------------------------------------------------- /Server/Server.js: -------------------------------------------------------------------------------- 1 | /*** 2 | * Copyright (C) Rodolfo Herrera Hernandez. All rights reserved. 3 | * Licensed under the MIT license. See LICENSE file in the project root 4 | * for full license information. 5 | * 6 | * =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 7 | * 8 | * In the vast universe of knowledge, the Open Source philosophy 9 | * shines like a radiant star. In this vein, Lovelace emerges 10 | * as an autonomous alternative to ChatGPT, based on 11 | * open source and self-hosting capabilities. 12 | * 13 | * Written in JavaScript, interacting with the library written 14 | * in Python, allows communication with ChatGPT through the use 15 | * of different services that facilitate its use by the public. 16 | * 17 | * For related information - https://github.com/CodeWithRodi/Lovelace/ 18 | * See also - https://github.com/xtekky/gpt4free 19 | * 20 | * :: https://lovelace.codewithrodi.com/ 21 | * :: https://lovelace-backend.codewithrodi.com/ 22 | * :: https://lovelace-docs.codewithrodi.com/ 23 | * 24 | * =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 25 | ****/ 26 | 27 | 'use-strict'; 28 | 29 | (require('dotenv')).config({ path: './.env' }); 30 | const Express = require('express'); 31 | const Helmet = require('helmet'); 32 | const XSS = require('xss-clean'); 33 | const Compression = require('compression'); 34 | const HPP = require('hpp'); 35 | const Cors = require('cors'); 36 | const SocketIO = require('socket.io'); 37 | const BootHelper = require('./Utilities/BootHelper'); 38 | const ChildProcess = require('child_process'); 39 | 40 | process.on('uncaughtException', (UncaughtServerError) => { 41 | console.error(UncaughtServerError); 42 | process.exit(1); 43 | }); 44 | 45 | const GlobalErrorHandler = require('./Controllers/Error'); 46 | const Application = Express(); 47 | const Port = process.env.SERVER_PORT || 8000; 48 | const Hostname = process.env.SERVER_HOST || '0.0.0.0'; 49 | const { HandleStreamedResponse } = require('./Controllers/Chat'); 50 | const { VersionChecker } = require('./Tools/GPT'); 51 | 52 | BootHelper.StandarizedBindingToApplication({ 53 | Application, 54 | Suffix: '/api/v1/', 55 | Routes: [ 56 | 'Chat' 57 | ], 58 | Middlewares: [ 59 | Helmet, 60 | [Cors, [ { origin: process.env.CORS_ORIGIN } ]], 61 | [Express.json, [ { limit: process.env.BODY_MAX_SIZE || '10kb' } ]], 62 | Compression, 63 | HPP, 64 | XSS, 65 | ], 66 | Settings: { 67 | Deactivated: [ 68 | 'x-powered-by' 69 | ] 70 | } 71 | }); 72 | 73 | Application.all('*', (Request, Response) => { 74 | if(Request.path.startsWith('/api/v1/')){ 75 | return Response.status(404).json({ 76 | Status: 'Error', 77 | Data: { 78 | Message: 'INVALID_API_REQUEST', 79 | URL: Request.originalUrl 80 | } 81 | }) 82 | } 83 | Response.redirect(process.env.CLIENT_HOST); 84 | }); 85 | 86 | Application.use(GlobalErrorHandler); 87 | const WebServer = BootHelper.GetConfiguredHTTPServerInstance(Application); 88 | HandleStreamedResponse(SocketIO(WebServer, { cors: { origin: process.env.CORS_ORIGIN } })); 89 | 90 | WebServer.listen(Port, Hostname, () => { 91 | setInterval(async () => { 92 | try{ 93 | const Response = await VersionChecker(); 94 | if(Response === 'UP_TO_DATE') 95 | return; 96 | ChildProcess.spawn('pip', ['install', '-U', 'g4f']); 97 | }catch(VersionUpdateError){ 98 | console.warn(VersionUpdateError); 99 | } 100 | }, 1000 * 60 * process.env.TIME_FOR_CHECK_AND_UPDATE_PACKAGES); // 3 Minutes 101 | console.log(`The server was started successfully in the network address (${Hostname}:${Port}).`); 102 | }); 103 | 104 | process.on('unhandledRejection', (UnhandledServerError) => { 105 | console.warn(UnhandledServerError); 106 | WebServer.close(() => process.exit(1)); 107 | }); 108 | -------------------------------------------------------------------------------- /Documentation/docs/Using-The-API.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 5 3 | hide_table_of_contents: true 4 | slug: /learning-how-to-use-the-api-for-interact-with-the-ai/ 5 | --- 6 | 7 | # Using the API provided by the backend to interact with the AI. 8 | If your intention is to utilize Lovelace for your individual needs and objectives, you may disregard the Client application implemented in ReactJS. Instead, divert your attention towards the Server, as it is where the enchantment truly takes place. 9 | 10 | Keep in mind that when communicating with the backend using the API or WebSocket's, the data sent as `Model or Role` is not case-sensitive, that is, if the value of `Model` is `gPT-3.5-TUrbO` will not matter, since it will be formatted from the backend, the `Prompt` is obviously not important either, but the value assigned to `Provider` is, in later readings you will learn how to obtain the available providers to be able to use when establishing an interaction with the AI, in the same way that you will be able to know what their respective models are, or you can now access the same path [`/api/v1/chat/providers/`](https://lovelace-backend.codewithrodi.com/api/v1/chat/providers/) of the public instance of the lovelace backend and view the information. 11 | 12 | Here's an example using the API via the native Fetch function: 13 | ```javascript 14 | const Data = { 15 | // Select the model you want to use for the request. 16 | // | 17 | Model: 'GPT-3.5-Turbo', // Recommended Model 18 | // Use a provider according to the model you used, consider 19 | // that you can see the list of providers next to the models 20 | // that have available in: 21 | // [GET REQUEST]: http://lovelace-backend.codewithrodi.com/api/v1/chat/providers/ 22 | Provider: 'GetGpt', // Recommended Provider, you can also use 'DeepAi' 23 | // GPT Role 24 | Role: 'User', 25 | // Prompt that you will send to the model 26 | Prompt: 'Hi Ada, Who are you?' 27 | }; 28 | 29 | // Note that if you want to use your own instance replace 30 | // for the address 31 | // from your server, or in case it is 32 | // is running locally. 33 | const Endpoint = 'https://lovelace-backend.codewithrodi.com/api/v1/chat/completions'; 34 | 35 | // We will make the request with the Fetch API provided in a way 36 | // native by JavaScript, specified in the first instance 37 | // the endpoint where our request will be made, while as a second 38 | // parameter we specify by means of an object the method, the header and the 39 | // body that will have the request. 40 | fetch(Endpoint, { 41 | // /api/v1/chat/completions/ 42 | method: 'POST', 43 | // We are sending a JSON, we specify the format 44 | // in the request header 45 | headers: { 'Content-Type': 'application/json' }, 46 | body: JSON.stringify(Data) 47 | }) 48 | // We transform the response into JSON 49 | .then((Response) => Response.json()) 50 | // Once the response has been transformed to the desired format, we proceed 51 | // to display the response from the AI ​​in the console. 52 | .then((Response) => console.log(Response.Data.Answer)) 53 | // Consider that has the following structure 54 | // Response -> { Data: { Answer: String }, Status: String(Success | ClientError) } 55 | .catch((RequestError) => console.error(RequestError)); 56 | ``` 57 | 58 | In case you want to use Axios when making the communication, you can consider: 59 | 60 | ```javascript 61 | const Axios = require('axios'); 62 | 63 | const Data = { 64 | Model: 'GPT-3.5-Turbo', // Recommended Model 65 | Provider: 'GetGpt', // Recommended Provider, you can also use 'DeepAi' 66 | // GPT Role 67 | Role: 'User', 68 | Prompt: 'Hi Ada, Who are you?' 69 | }; 70 | 71 | const Endpoint = 'https://lovelace-backend.codewithrodi.com/api/v1/chat/completions'; 72 | 73 | (async function(){ 74 | const Response = (await Axios.post(Endpoint, Data, { headers: { 'Content-Type': 'application/json' } })).data; 75 | console.log(Response.Data.Answer); 76 | })(); 77 | ``` 78 | 79 | You can see how the client communicates with the backend via the API by looking at the `Client/src/Services/Chat/Context.jsx` and `Client/src/Services/Chat/Service.js` files, where magic happens. -------------------------------------------------------------------------------- /Client/src/Components/Chat/SideMenu/SideMenu.jsx: -------------------------------------------------------------------------------- 1 | /*** 2 | * Copyright (C) Rodolfo Herrera Hernandez. All rights reserved. 3 | * Licensed under the MIT license. See LICENSE file in the project root 4 | * for full license information. 5 | * 6 | * =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 7 | * 8 | * In the vast universe of knowledge, the Open Source philosophy 9 | * shines like a radiant star. In this vein, Lovelace emerges 10 | * as an autonomous alternative to ChatGPT, based on 11 | * open source and self-hosting capabilities. 12 | * 13 | * Written in JavaScript, interacting with the library written 14 | * in Python, allows communication with ChatGPT through the use 15 | * of different services that facilitate its use by the public. 16 | * 17 | * For related information - https://github.com/CodeWithRodi/Lovelace/ 18 | * See also - https://github.com/xtekky/gpt4free 19 | * 20 | * :: https://lovelace.codewithrodi.com/ 21 | * :: https://lovelace-backend.codewithrodi.com/ 22 | * :: https://lovelace-docs.codewithrodi.com/ 23 | * 24 | * =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 25 | ****/ 26 | 27 | import React, { useContext } from 'react'; 28 | import { GrPowerReset } from 'react-icons/gr'; 29 | import { VscHistory } from 'react-icons/vsc'; 30 | import { FiGithub } from 'react-icons/fi'; 31 | import { Tooltip } from '@mui/material'; 32 | import { ChatContext } from '../../../Services/Chat/Context'; 33 | import { CoreContext } from '../../../Services/Core/Context'; 34 | import StoredChatResponsesViewer from '../StoredChatResponsesViewer'; 35 | import './SideMenu.css'; 36 | 37 | const SideMenu = () => { 38 | const { UserExperience, HandleChatReset, ServerCommunication } = useContext(ChatContext); 39 | const { L } = useContext(CoreContext); 40 | const Options = [ 41 | { 42 | Title: L('CHAT_SIDE_MENU_RESET_CHAT'), 43 | TooltipTitle: L('TOOLTIP_RESET_CHAT'), 44 | Icon: GrPowerReset, 45 | Callback: HandleChatReset, 46 | DisableOnLoading: true 47 | }, 48 | { 49 | Title: L('CHAT_SIDE_MENU_MY_ACTIVITY'), 50 | TooltipTitle: L('TOOLTIP_MY_ACTIVITY'), 51 | Icon: VscHistory, 52 | Container: , 53 | DisableOnLoading: true 54 | }, 55 | { 56 | Title: L('CHAT_SIDE_MENU_GITHUB'), 57 | TooltipTitle: L('TOOLTIP_GITHUB'), 58 | Icon: FiGithub, 59 | Callback: () => window.open(import.meta.env.VITE_SOFTWARE_REPOSITORY_LINK, '_blank') 60 | } 61 | ] 62 | 63 | return ( 64 |
65 |
66 | {Options.map(({ Title, TooltipTitle, Icon, Callback, DisableOnLoading, Container }, Index) => ( 67 |
68 | 69 |
70 | 71 | 72 | 73 | {Title} 74 |
75 |
76 |
77 | {Container} 78 |
79 |
80 | ))} 81 |
82 |
83 | 84 | 88 | 89 |

{L('CHAT_SIDE_MENU_BOTTOM_MSG')}

90 |
91 |
92 | ); 93 | }; 94 | 95 | export default SideMenu; -------------------------------------------------------------------------------- /Server/Controllers/Chat.js: -------------------------------------------------------------------------------- 1 | /*** 2 | * Copyright (C) Rodolfo Herrera Hernandez. All rights reserved. 3 | * Licensed under the MIT license. See LICENSE file in the project root 4 | * for full license information. 5 | * 6 | * =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 7 | * 8 | * In the vast universe of knowledge, the Open Source philosophy 9 | * shines like a radiant star. In this vein, Lovelace emerges 10 | * as an autonomous alternative to ChatGPT, based on 11 | * open source and self-hosting capabilities. 12 | * 13 | * Written in JavaScript, interacting with the library written 14 | * in Python, allows communication with ChatGPT through the use 15 | * of different services that facilitate its use by the public. 16 | * 17 | * For related information - https://github.com/CodeWithRodi/Lovelace/ 18 | * See also - https://github.com/xtekky/gpt4free 19 | * 20 | * :: https://lovelace.codewithrodi.com/ 21 | * :: https://lovelace-backend.codewithrodi.com/ 22 | * :: https://lovelace-docs.codewithrodi.com/ 23 | * 24 | * =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 25 | ****/ 26 | 27 | const { 28 | AvailableProviders, 29 | AvailableModels, 30 | AvailableRoles, 31 | DefaultChatParameters, 32 | CatchAsync, 33 | RuntimeError } = require('../Utilities/Runtime'); 34 | const { GPT, CollectProviders } = require('../Tools/GPT'); 35 | 36 | const SanitizedClientQuery = (Query, CommunicationMode, Next) => { 37 | // TODO: Add a maximum length for prompt. 38 | let { Model, Role, Provider, Messages, Prompt } = Query; 39 | (!Model) && (Model = DefaultChatParameters.Model); 40 | (!Role) && (Role = DefaultChatParameters.Role); 41 | (!Provider) && (Provider = DefaultChatParameters.Provider); 42 | (!Array.isArray(Messages) || !Messages) && (Messages = [ { Role, Content: Prompt } ]) 43 | Model = Model.toLowerCase(); 44 | Role = Role.toLowerCase(); 45 | if( 46 | !AvailableProviders[CommunicationMode].includes(Provider) || 47 | !AvailableRoles.includes(Role) || 48 | !AvailableModels.includes(Model) 49 | ){ 50 | // TODO: Add a API Controller that envolves all Lovelace 51 | // TODO: Backend Error IDs, with a description of it. 52 | const ErrorID = 'Chat::Invalid::Parameter'; 53 | return Next((CommunicationMode === 'API') 54 | ? (new RuntimeError(ErrorID)) : (ErrorID)); 55 | } 56 | return { Messages, Model, Provider }; 57 | }; 58 | 59 | // TODO: Add a for retrieve 60 | // TODO: the available models and roles, including providers. 61 | exports.GetProviders = CatchAsync(async (_, Response, Next) => { 62 | try{ 63 | const Providers = await CollectProviders(); 64 | Response.status(200).json({ Status: 'Success', Data: JSON.parse(Providers) }); 65 | }catch({ ErrorID, Exception }){ 66 | Next(new RuntimeError(ErrorID, 500, Exception)); 67 | } 68 | }); 69 | 70 | exports.HandleCompletion = CatchAsync(async (Request, Response, Next) => { 71 | const { Model, Messages, Provider } = SanitizedClientQuery(Request.body, 'API', Next); 72 | try{ 73 | const Answer = await GPT({ Model, Messages, Provider }, 'API'); 74 | Response.status(200).json({ Status: 'Success', Data: { Answer } }); 75 | }catch({ ErrorID, Exception }){ 76 | Next(new RuntimeError(ErrorID, 500, Exception)); 77 | } 78 | }); 79 | 80 | exports.HandleStreamedResponse = (WebSocket) => { 81 | // TODO: Is this the correct way of do it?, Can it generate an eventually Callback Hell? 82 | WebSocket.on('connection', (Socket) => { 83 | Socket.on('Prompt', async (Query, Callback) => { 84 | const { Model, Messages, Provider } = SanitizedClientQuery(Query, 85 | 'WS', (ErrorID) => Socket.emit('Response', ErrorID)); 86 | let GPTError = null; 87 | try{ 88 | await GPT({ Model, Messages, Provider }, 89 | 'WS', (Answer) => Socket.emit('Response', Answer)); 90 | }catch(Exception){ 91 | GPTError = Exception; 92 | }finally{ 93 | (Callback) && (Callback(GPTError)); 94 | } 95 | }); 96 | }); 97 | }; -------------------------------------------------------------------------------- /Client/src/Components/General/Layout/Layout.css: -------------------------------------------------------------------------------- 1 | /*** 2 | * Copyright (C) Rodolfo Herrera Hernandez. All rights reserved. 3 | * Licensed under the MIT license. See LICENSE file in the project root 4 | * for full license information. 5 | * 6 | * =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 7 | * 8 | * In the vast universe of knowledge, the Open Source philosophy 9 | * shines like a radiant star. In this vein, Lovelace emerges 10 | * as an autonomous alternative to ChatGPT, based on 11 | * open source and self-hosting capabilities. 12 | * 13 | * Written in JavaScript, interacting with the library written 14 | * in Python, allows communication with ChatGPT through the use 15 | * of different services that facilitate its use by the public. 16 | * 17 | * For related information - https://github.com/CodeWithRodi/Lovelace/ 18 | * See also - https://github.com/xtekky/gpt4free 19 | * 20 | * :: https://lovelace.codewithrodi.com/ 21 | * :: https://lovelace-backend.codewithrodi.com/ 22 | * :: https://lovelace-docs.codewithrodi.com/ 23 | * 24 | * =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 25 | ****/ 26 | 27 | #Header #Brand-Box #Brand-Title{ 28 | text-transform: uppercase; 29 | cursor: pointer; 30 | font-size: 1.4rem; 31 | letter-spacing: 0.2rem; 32 | will-change: transform; 33 | } 34 | 35 | #Header #Brand-Box #Brand-Title:hover{ 36 | opacity: .9; 37 | } 38 | 39 | #Header{ 40 | padding: 1rem; 41 | display: flex; 42 | z-index: 200; 43 | background-color: #121212; 44 | flex-direction: row; 45 | position: fixed; 46 | justify-content: space-between; 47 | width: 100%; 48 | } 49 | 50 | #Header #Navegation-Box{ 51 | display: flex; 52 | gap: 1rem; 53 | align-items: center; 54 | } 55 | 56 | #Header[data-path='/'] #Navegation-Box{ 57 | margin-top: 1rem; 58 | background-color: transparent; 59 | } 60 | 61 | #Header[data-path='/']{ 62 | width: auto; 63 | flex-direction: column; 64 | } 65 | 66 | #Header #Navegation-Box .Navegation-Item-Link{ 67 | padding: .2rem 1rem; 68 | font-size: .8rem; 69 | } 70 | 71 | .Mobile-Menu-Content-Item-Box{ 72 | font-size: 1rem; 73 | font-weight: 700; 74 | text-transform: uppercase; 75 | cursor: pointer; 76 | } 77 | 78 | .Mobile-Menu-Content-Item-Box:hover{ 79 | opacity: .85; 80 | } 81 | 82 | #Mobile-Menu-Navegation-Box{ 83 | list-style-type: none; 84 | display: flex; 85 | flex-direction: column; 86 | gap: 2rem; 87 | justify-content: center; 88 | height: 100%; 89 | } 90 | 91 | #Mobile-Menu-External-References-Box{ 92 | padding: 2rem 0; 93 | overflow-x: scroll; 94 | display: flex; 95 | gap: 1rem; 96 | } 97 | 98 | #Mobile-Menu-External-References-Box .Button{ 99 | padding: .5rem 1rem; 100 | } 101 | 102 | #Mobile-Menu-Content-Box{ 103 | padding-left: 2rem; 104 | display: flex; 105 | justify-content: space-between; 106 | height: 100%; 107 | width: 100%; 108 | flex-direction: column; 109 | background-color: #000000; 110 | } 111 | 112 | #Mobile-Menu-Box{ 113 | position: fixed; 114 | bottom: 0; 115 | width: 100%; 116 | height: calc(100% - 70px); 117 | display: flex; 118 | justify-content: flex-start; 119 | align-items: center; 120 | z-index: 100; 121 | } 122 | 123 | @media screen and (max-width: 768px){ 124 | #Header #Brand-Box #Brand-Title{ 125 | font-size: .95rem; 126 | } 127 | 128 | #Mobile-Menu-Box{ 129 | height: calc(100% - 60px); 130 | } 131 | 132 | #Header[data-path='/'] #Navegation-Box{ 133 | margin-top: 0; 134 | } 135 | 136 | #Header{ 137 | height: 60px; 138 | align-items: center; 139 | justify-content: space-between; 140 | width: 100%; 141 | flex-direction: row; 142 | background-color: #000000; 143 | } 144 | 145 | 146 | #Header[data-path='/']{ 147 | flex-direction: row; 148 | width: 100%; 149 | } 150 | 151 | #Header #Navegation-Box .Navegation-Item-Link{ 152 | font-size: .6rem; 153 | } 154 | 155 | #Header #Navegation-Box{ 156 | flex-direction: row-reverse; 157 | gap: 2rem; 158 | } 159 | } -------------------------------------------------------------------------------- /Documentation/docs/Mounting-Client.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 4 3 | hide_table_of_contents: true 4 | slug: /mounting-webapp-in-the-network/ 5 | --- 6 | 7 | # Setting up the Vite + React application, delving into the client. 8 | The client application is built with ReactJS using Vite as its development tool. With just a few terminal commands, you can quickly set up and deploy the application on your network in no time! By following our instructions and utilizing the power of ReactJS and Vite, you'll experience a seamless and efficient setup process. 9 | 10 | Make sure that, in order to use the web application correctly, it is necessary that the server is already running on the network. 11 | 12 | ```bash 13 | # Accessing the existing folder within the cloned repository 14 | cd Client/ 15 | 16 | # Assuming you have already installed the necessary npm packages 17 | # we will proceed to start the server in development mode 18 | npm run dev 19 | ``` 20 | 21 | Happy hacking!... Your server should be running at `http://0.0.0.0:5173/`. 22 | 23 | ## Modifying environment variables... 24 | In the same way in which it was done in the previous reading, the list of environment variables that the client application has in its ".env" file will be presented next, along with a description of it. 25 | 26 | 27 | ```bash 28 | # Address where the backend server was mounted, you must 29 | # be sure to specify in the address if you have ridden 30 | # the server under HTTPS, changing to ;) 31 | VITE_SERVER = http://0.0.0.0:8000 32 | 33 | # The server has a suffix to be able to access its respective API 34 | # in this case we use v1 35 | VITE_API_SUFFIX = /api/v1 36 | 37 | # Others... 38 | VITE_DONATE_LINK = https://ko-fi.com/codewithrodi 39 | VITE_GPT4FREE_LINK = https://github.com/xtekky/gpt4free 40 | VITE_SOFTWARE_REPOSITORY_LINK = https://github.com/codewithrodi/Lovelace 41 | ``` 42 | 43 | ## Modifying the port and hostname of the client's server 44 | In case you want to modify the network address or the port that is used when launching the Vite server on the network, you can consider modifying the `vite.config.js` file. This file contains the configuration settings for the Vite server. Below are the contents of the `vite.config.js` file: 45 | 46 | ```javascript 47 | export default defineConfig({ 48 | plugins: [react()], 49 | server: { 50 | // If you want to change the network address where the server will be mounted 51 | // you must change <0.0.0.0> to the desired one. 52 | host: '0.0.0.0', 53 | // Following the same line above, you must modify the port <5173> 54 | // for which you want to ride on the network. 55 | port: 5173 56 | }, 57 | define: { 58 | global: {} 59 | } 60 | }); 61 | ``` 62 | 63 | Please note that modifying these settings should be done with caution, as it may affect the accessibility of the server. Make sure to choose a suitable network address and a port that is not already in use. 64 | 65 | ## Why is Vite used in the client application? 66 | Vite is a popular choice for developing web applications written in JavaScript due to its highly efficient environment. It offers significant advantages such as drastically reducing the startup time when loading new modules or compiling the source code during the development process. By leveraging Vite, developers can experience improved productivity and faster development cycles. Its speed and performance optimizations make it a valuable tool for web development projects. 67 | 68 | ## Internationalization within the Application 69 | The web application has the ability to detect the language of the web browser from which the platform is accessed, in order to later be able to detect if there is a translation of the content available in the requested language, if it does not exist, a translation will be returned. by default, which corresponds to English. 70 | 71 | Consider that, to add new translations, you can access `Client/src/Locale/`, where this last `Locale/` folder houses a series of JSONs which are in the following format `{LANGUAGE_IN_ISO_369}.json`; In case you want to add a new translation, you just have to follow the format and copy the respective keys whose value is updated to the desired language that you are creating. 72 | 73 | Currently, the following translations exist within the web application: ```French - Arabic - Chinese - German - English - Spanish - Italian - Portuguese - Russian - Turkish```. 74 | 75 | -------------------------------------------------------------------------------- /Client/src/Components/Chat/ChatViewer/ChatViewer.css: -------------------------------------------------------------------------------- 1 | /*** 2 | * Copyright (C) Rodolfo Herrera Hernandez. All rights reserved. 3 | * Licensed under the MIT license. See LICENSE file in the project root 4 | * for full license information. 5 | * 6 | * =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 7 | * 8 | * In the vast universe of knowledge, the Open Source philosophy 9 | * shines like a radiant star. In this vein, Lovelace emerges 10 | * as an autonomous alternative to ChatGPT, based on 11 | * open source and self-hosting capabilities. 12 | * 13 | * Written in JavaScript, interacting with the library written 14 | * in Python, allows communication with ChatGPT through the use 15 | * of different services that facilitate its use by the public. 16 | * 17 | * For related information - https://github.com/CodeWithRodi/Lovelace/ 18 | * See also - https://github.com/xtekky/gpt4free 19 | * 20 | * :: https://lovelace.codewithrodi.com/ 21 | * :: https://lovelace-backend.codewithrodi.com/ 22 | * :: https://lovelace-docs.codewithrodi.com/ 23 | * 24 | * =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 25 | ****/ 26 | 27 | #Chat-Viewer-Box{ 28 | width: 100%; 29 | border-radius: 1rem; 30 | background-color: #222327; 31 | display: flex; 32 | justify-content: space-between; 33 | flex-direction: column; 34 | padding: 1rem; 35 | margin: .5rem; 36 | } 37 | 38 | #Chat-Viewer-Box #Chat-History-Box{ 39 | display: flex; 40 | gap: 1rem; 41 | height: 100%; 42 | background-color: transparent; 43 | flex-direction: column; 44 | overflow-y: scroll; 45 | padding-right: .5rem; 46 | } 47 | 48 | #Chat-Viewer-Box #Software-Presentation-Box > :nth-child(2) > :nth-child(2){ 49 | margin-top: .5rem; 50 | } 51 | 52 | #Chat-Viewer-Box #Software-Presentation-Box{ 53 | padding: 1rem; 54 | background-color: #121212; 55 | border-radius: 1rem; 56 | width: 99%; 57 | color: #FFFFFF; 58 | display: flex; 59 | gap: 1rem; 60 | } 61 | 62 | #Chat-Viewer-Box #Software-Presentation-Recommendation-Box{ 63 | display: flex; 64 | flex-direction: column; 65 | margin-top: 1rem; 66 | gap: .3rem; 67 | } 68 | 69 | #Chat-Viewer-Box #Input-Decoration-Box{ 70 | padding: 0 .7rem; 71 | } 72 | 73 | #Chat-Viewer-Box #Input-Decoration-Box .MuiIconButton-root{ 74 | color: #FFFFFF; 75 | } 76 | 77 | #Chat-Viewer-Box #Chat-Right-Icon{ 78 | margin-left: 1rem; 79 | } 80 | 81 | #Chat-Viewer-Box #Chat-Input-Box{ 82 | width: 100%; 83 | display: flex; 84 | gap: 1rem; 85 | align-items: center; 86 | border: 1px solid #FFFFFF; 87 | border-radius: 0.25rem; 88 | margin: 0 auto; 89 | } 90 | 91 | #Chat-Viewer-Box #Software-Presentation-Recommendation-Box .Suggestion-Box .Suggestion{ 92 | color: #8ab4f8; 93 | font-size: .9rem; 94 | will-change: transform; 95 | cursor: pointer; 96 | } 97 | 98 | #Chat-Viewer-Box #Software-Presentation-Recommendation-Box .Suggestion-Box .Suggestion[data-isloading='true']{ 99 | opacity: .8; 100 | cursor: not-allowed; 101 | } 102 | 103 | #Chat-Viewer-Box #Chat-Input{ 104 | width: 100%; 105 | } 106 | 107 | #Chat-Viewer-Box #Software-Presentation-Recommendation-Box .Suggestion-Box .Suggestion:hover{ 108 | color: #9dafca; 109 | } 110 | 111 | #Chat-Viewer-Box #Chat-Bottom-Box{ 112 | display: flex; 113 | width: 80%; 114 | margin: .7rem auto 0; 115 | align-items: center; 116 | height: auto; 117 | } 118 | 119 | @media screen and (max-width: 768px){ 120 | #Chat-Viewer-Box #Software-Presentation-Recommendation-Box .Suggestion-Box .Suggestion{ 121 | font-size: .75rem; 122 | } 123 | 124 | #Chat-Viewer-Box #Chat-Input-Box{ 125 | width: 99%; 126 | border-radius: .3rem; 127 | margin: .5rem auto; 128 | } 129 | 130 | #Chat-Viewer-Box #Chat-Input{ 131 | padding: .8rem; 132 | } 133 | 134 | #Chat-Viewer-Box #Chat-Bottom-Box{ 135 | width: 100%; 136 | } 137 | 138 | #Chat-Viewer-Box{ 139 | min-height: 100vh; 140 | border-radius: 0; 141 | padding: 0; 142 | background-color: #000000; 143 | } 144 | 145 | #Chat-Viewer-Box #Software-Presentation-Box{ 146 | padding: 0 1rem; 147 | background-color: #000000; 148 | margin-bottom: 1rem; 149 | border-radius: 0; 150 | } 151 | 152 | #HChat-Viewer-Box #Chat-History-Box{ 153 | padding: 0; 154 | overflow-y: unset; 155 | } 156 | } -------------------------------------------------------------------------------- /Client/src/Components/Chat/StoredChatResponsesViewer/StoredChatResponsesViewer.jsx: -------------------------------------------------------------------------------- 1 | /*** 2 | * Copyright (C) Rodolfo Herrera Hernandez. All rights reserved. 3 | * Licensed under the MIT license. See LICENSE file in the project root 4 | * for full license information. 5 | * 6 | * =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 7 | * 8 | * In the vast universe of knowledge, the Open Source philosophy 9 | * shines like a radiant star. In this vein, Lovelace emerges 10 | * as an autonomous alternative to ChatGPT, based on 11 | * open source and self-hosting capabilities. 12 | * 13 | * Written in JavaScript, interacting with the library written 14 | * in Python, allows communication with ChatGPT through the use 15 | * of different services that facilitate its use by the public. 16 | * 17 | * For related information - https://github.com/CodeWithRodi/Lovelace/ 18 | * See also - https://github.com/xtekky/gpt4free 19 | * 20 | * :: https://lovelace.codewithrodi.com/ 21 | * :: https://lovelace-backend.codewithrodi.com/ 22 | * :: https://lovelace-docs.codewithrodi.com/ 23 | * 24 | * =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 25 | ****/ 26 | 27 | import React, { useContext } from 'react'; 28 | import { StoredChatResponses, DeleteItemFromChatHistory } from '../../../Services/Chat/Service'; 29 | import { FormatChatResponseListDate } from '../../../Utilities/Algorithms'; 30 | import { SlTrash } from 'react-icons/sl'; 31 | import { ChatContext } from '../../../Services/Chat/Context'; 32 | import { CoreContext } from '../../../Services/Core/Context'; 33 | import { Tooltip } from '@mui/material'; 34 | import Popover from '../../General/Popover'; 35 | import './StoredChatResponsesViewer.css'; 36 | 37 | const StoredChatResponsesViewer = () => { 38 | const { 39 | HandleChatReset, 40 | HandleChatResponseSelect, 41 | UserExperience, 42 | MountModifiedChatResponseList } = useContext(ChatContext); 43 | const { L } = useContext(CoreContext); 44 | 45 | return ( 46 |
47 | {Object.keys(StoredChatResponses() || []).map((StoredListDate, Index) => ( 48 |
49 | 53 |

{ 56 | if(UserExperience.GetSelectedList === StoredListDate){ 57 | UserExperience.SetSelectedList(''); 58 | HandleChatReset(); 59 | return; 60 | } 61 | HandleChatResponseSelect(StoredListDate); 62 | UserExperience.SetSelectedList(StoredListDate); 63 | }} 64 | >{FormatChatResponseListDate(StoredListDate)}

65 |
66 | {(UserExperience.GetSelectedList === StoredListDate) && ( 67 |
68 | {StoredChatResponses()[StoredListDate].map(({ Prompt, CreatedAt, ID }, Index) => ( 69 | { 73 | DeleteItemFromChatHistory(ID, StoredListDate); 74 | MountModifiedChatResponseList(ID); 75 | }, Content: L('STORED_CHAT_RESPONSES_VIEWER_DELETE'), Icon: SlTrash } 76 | ] 77 | }} 78 | key={Index}> 79 |
80 |

{Prompt}

81 | {CreatedAt} 82 |
83 |
84 | ))} 85 |
86 | )} 87 |
88 | ))} 89 |
90 | ); 91 | }; 92 | 93 | export default StoredChatResponsesViewer; -------------------------------------------------------------------------------- /Documentation/docs/Available-Providers.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 7 3 | hide_table_of_contents: true 4 | slug: /available-providers-and-models/ 5 | --- 6 | 7 | # Using the API to get the list of available providers and models. 8 | Consider that, despite the fact that the `GPT4FREE` python library is used within the backend, the latter's providers are different from those offered by Lovelace. You can obtain the list of available providers using the API, where you will obtain information such as the models that it allows to use, the web address where the service is hosted and the name that must be specified when interacting with the AI ​​as you have seen in the examples. previous (API, WS). 9 | 10 | The response you should get from `https://lovelace-backend.codewithrodi.com/api/v1/chat/providers/` should be: 11 | ```json 12 | { 13 | "Status":"Success", 14 | "Data":{ 15 | "Providers":{ 16 | // List of providers available to use on WebSocket's 17 | "WS":[ 18 | { 19 | // Name to specify when making the query 20 | "Name":"DeepAi", 21 | // Web address where the service is hosted 22 | "Website":"https://deepai.org", 23 | // Available models 24 | "Models":["gpt-3.5-turbo"] 25 | 26 | }, 27 | // ! Others WebSocket's providers... 28 | { "Name":"Theb", "Website":"https://theb.ai", "Models":["gpt-3.5-turbo"] }, 29 | { "Name":"Yqcloud", "Website":"https://chat9.yqcloud.top/", "Models":["gpt-3.5-turbo"] }, 30 | { "Name":"You", "Website":"https://you.com", "Models":["gpt-3.5-turbo"] }, 31 | { "Name":"GetGpt", "Website":"https://chat.getgpt.world/", "Models":["gpt-3.5-turbo"] } 32 | ], 33 | // List of Providers available to be able to use through the API 34 | "API":[ 35 | { 36 | // Name to specify when making the query 37 | "Name":"Aichat", 38 | // Web address where the service is hosted 39 | "Website":"https://chat-gpt.org/chat", 40 | // Available models 41 | "Models":["gpt-3.5-turbo"] 42 | }, 43 | // ! Others API providers... 44 | { "Name":"ChatgptLogin", "Website":"https://chatgptlogin.ac", "Models":["gpt-3.5-turbo"] }, 45 | { "Name":"DeepAi", "Website":"https://deepai.org", "Models":["gpt-3.5-turbo"] }, 46 | { "Name":"Yqcloud", "Website":"https://chat9.yqcloud.top/", "Models":["gpt-3.5-turbo"] }, 47 | { "Name":"You", "Website":"https://you.com", "Models":["gpt-3.5-turbo"] }, 48 | { "Name":"GetGpt", "Website":"https://chat.getgpt.world/", "Models":["gpt-3.5-turbo"] } 49 | ] 50 | } 51 | } 52 | } 53 | ``` 54 | 55 | As you have seen, the list of providers is divided into 2 parts, one for those queries made through the API while for those that use WebSocket's. 56 | 57 | ## Getting the list of providers from JavaScript... 58 | Unlike other examples where requests to the Lovelace backend server are involved, obtaining the list of providers and their respective available models is quite an easy task, since we only have to send a [GET] request to `/api/v1 /chat/providers/`, where the response will be the JSON that was shown to you previously. 59 | 60 | For the following example, we'll use Axios within NodeJS, which you can install using the NPM package manager using the `npm i axios` command. 61 | 62 | ```javascript 63 | const Axios = require('axios'); 64 | 65 | (async function(){ 66 | // Consider that, you can replace with 67 | // the address where your backend server is mounted. If the latter is 68 | // running locally on your network, you can use in case 69 | // that you haven't modified the default configuration. 70 | const Endpoint = 'https://lovelace-backend.codewithrodi.com/api/v1/chat/providers/'; 71 | try{ 72 | // Making the request, and accessing the response after it 73 | // it has been completed. 74 | const Response = (await Axios.get(Endpoint)).data; 75 | // Response -> { Status: String(Success | ClientError), Data: { Providers: Object } } 76 | 77 | // Displaying the providers in the terminal. 78 | console.log(Response.Data.Providers); 79 | }catch(RequestError){ 80 | console.error(RequestError); 81 | } 82 | })(); 83 | ``` 84 | 85 | Or, if you want to use the native JavaScript Fetch feature and experiment right now in your web browser's console, you might consider: 86 | 87 | ```javascript 88 | const Endpoint = 'https://lovelace-backend.codewithrodi.com/api/v1/chat/providers/'; 89 | 90 | fetch(Endpoint) 91 | .then((Response) => Response.json()) 92 | .then((Response) => console.log(Response.Data.Providers)) 93 | .catch((RequestError) => console.error(RequestError)); 94 | ``` -------------------------------------------------------------------------------- /Client/src/Utilities/Runtime.js: -------------------------------------------------------------------------------- 1 | /*** 2 | * Copyright (C) Rodolfo Herrera Hernandez. All rights reserved. 3 | * Licensed under the MIT license. See LICENSE file in the project root 4 | * for full license information. 5 | * 6 | * =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 7 | * 8 | * In the vast universe of knowledge, the Open Source philosophy 9 | * shines like a radiant star. In this vein, Lovelace emerges 10 | * as an autonomous alternative to ChatGPT, based on 11 | * open source and self-hosting capabilities. 12 | * 13 | * Written in JavaScript, interacting with the library written 14 | * in Python, allows communication with ChatGPT through the use 15 | * of different services that facilitate its use by the public. 16 | * 17 | * For related information - https://github.com/CodeWithRodi/Lovelace/ 18 | * See also - https://github.com/xtekky/gpt4free 19 | * 20 | * :: https://lovelace.codewithrodi.com/ 21 | * :: https://lovelace-backend.codewithrodi.com/ 22 | * :: https://lovelace-docs.codewithrodi.com/ 23 | * 24 | * =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 25 | ****/ 26 | 27 | import Axios from 'axios'; 28 | import { ReplaceURLParameters } from './Algorithms'; 29 | 30 | export const With = (Callback, ...Arguments) => Callback(...Arguments); 31 | 32 | export const QuickLocalStorageRescue = (BlockStorageID) => { 33 | try{ 34 | return JSON.parse(localStorage.getItem(BlockStorageID)); 35 | }catch{ 36 | return {}; 37 | } 38 | }; 39 | 40 | export class ServerRequestBuilder{ 41 | constructor({ SetError }){ 42 | this.SetError = SetError; 43 | }; 44 | 45 | Register = ({ 46 | Callback = undefined, 47 | Arguments = undefined, 48 | UpdateState = { Setter: undefined, Callback: undefined } 49 | }) => new Promise(async (Resolve, Reject) => { 50 | try{ 51 | const Response = (await Callback(...(Arguments || []))); 52 | (UpdateState.Callback) && (UpdateState.Setter(UpdateState.Callback(Response?.data || Response))); 53 | Resolve(Response?.data || Response); 54 | }catch(Rejection){ 55 | (this.SetError) && 56 | (this.SetError(Rejection?.response?.data)); 57 | Reject(Rejection?.response?.data); 58 | } 59 | return Response; 60 | }); 61 | }; 62 | 63 | export const SetDocumentTitle = (Title) => document.title = Title + ' - Pantera'; 64 | 65 | export class StandardizedAPIRequestBuilder{ 66 | constructor({ Endpoint }){ 67 | this.Endpoint = Endpoint; 68 | this.SetError = () => {}; 69 | }; 70 | 71 | BindErrorSetter = (Setter) => this.SetError = Setter; 72 | 73 | Register = ({ 74 | Path, 75 | Method = 'GET', 76 | EnableMassiveLoad = false 77 | }) => { 78 | const Buffer = { 79 | Configuration: {}, 80 | Arguments: [], 81 | FilterBuffer: '', 82 | Method: Method.toLowerCase() }; 83 | // ! Is the best option define this function here? 84 | const AppendParameter = (Identifier, Value) => 85 | (Buffer.FilterBuffer += ((!Buffer.FilterBuffer) ? (`?`) : ('&')) + `${Identifier}=${Value}`); 86 | return ({ 87 | Body, 88 | UpdateState = { Setter: undefined, Callback: undefined }, 89 | QueryParams = [], 90 | Filter = { 91 | Fields: undefined, 92 | Sort: undefined, 93 | Search: undefined, 94 | Paginate: undefined 95 | } 96 | }) => { 97 | (QueryParams?.length) && (Path = ReplaceURLParameters(Path, QueryParams)); 98 | (EnableMassiveLoad && !Filter?.Paginate?.Limit) && (Filter.Paginate = { Limit: -1 }); 99 | (Filter?.Sort) && (AppendParameter('Sort', Filter.Sort.join(','))); 100 | (Filter?.Fields) && (AppendParameter('Fields', Filter.Fields.join(','))); 101 | (Filter?.Search) && (AppendParameter('Search', Filter.Search)); 102 | (Filter?.Paginate?.Limit) && (AppendParameter('Limit', Filter.Paginate.Limit)); 103 | (Filter?.Paginate?.Page) && (AppendParameter('Page', Filter.Paginate.Page)); 104 | Buffer.Arguments = [ 105 | `${import.meta.env.VITE_SERVER + import.meta.env.VITE_API_SUFFIX + this.Endpoint}${Path}` 106 | .concat(Buffer.FilterBuffer) ]; 107 | if(['post', 'put', 'patch'].includes(Buffer.Method)) 108 | Buffer.Arguments.push(Body); 109 | Buffer.Arguments.push(Buffer.Configuration); 110 | return new ServerRequestBuilder({ SetError: this.SetError }).Register({ 111 | Callback: Axios[Buffer.Method], 112 | Arguments: Buffer.Arguments, 113 | UpdateState 114 | }); 115 | }; 116 | }; 117 | }; 118 | -------------------------------------------------------------------------------- /Client/src/Components/General/MenuIcon/MenuIcon.css: -------------------------------------------------------------------------------- 1 | /*** 2 | * Copyright (C) Rodolfo Herrera Hernandez. All rights reserved. 3 | * Licensed under the MIT license. See LICENSE file in the project root 4 | * for full license information. 5 | * 6 | * =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 7 | * 8 | * In the vast universe of knowledge, the Open Source philosophy 9 | * shines like a radiant star. In this vein, Lovelace emerges 10 | * as an autonomous alternative to ChatGPT, based on 11 | * open source and self-hosting capabilities. 12 | * 13 | * Written in JavaScript, interacting with the library written 14 | * in Python, allows communication with ChatGPT through the use 15 | * of different services that facilitate its use by the public. 16 | * 17 | * For related information - https://github.com/CodeWithRodi/Lovelace/ 18 | * See also - https://github.com/xtekky/gpt4free 19 | * 20 | * :: https://lovelace.codewithrodi.com/ 21 | * :: https://lovelace-backend.codewithrodi.com/ 22 | * :: https://lovelace-docs.codewithrodi.com/ 23 | * 24 | * =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 25 | ****/ 26 | 27 | #Menu-Icon-Box .Toggle{ 28 | display: block; 29 | cursor: pointer; 30 | } 31 | 32 | #Menu-Icon-Box .Toggle input{ 33 | display: none; 34 | } 35 | 36 | #Menu-Icon-Box .Toggle input + div{ 37 | width: 20px; 38 | height: 14px; 39 | position: relative; 40 | } 41 | 42 | #Menu-Icon-Box .Toggle input + div div{ 43 | position: absolute; 44 | left: 0; 45 | top: 0; 46 | right: 0; 47 | bottom: 0; 48 | transition: transform 0.5s ease; 49 | } 50 | 51 | #Menu-Icon-Box .Toggle input + div div span{ 52 | display: block; 53 | position: absolute; 54 | left: 0; 55 | right: 0; 56 | } 57 | 58 | #Menu-Icon-Box .Toggle input + div div span:first-child{ 59 | top: 0; 60 | } 61 | 62 | #Menu-Icon-Box .Toggle input + div div span:first-child:before, #Menu-Icon-Box .Toggle input + div div span:first-child:after{ 63 | top: 0; 64 | } 65 | 66 | #Menu-Icon-Box .Toggle input + div div span:last-child{ 67 | bottom: 0; 68 | } 69 | 70 | #Menu-Icon-Box .Toggle input + div div span:last-child:before, #Menu-Icon-Box .Toggle input + div div span:last-child:after{ 71 | bottom: 0; 72 | } 73 | 74 | #Menu-Icon-Box .Toggle input + div div span:before, #Menu-Icon-Box .Toggle input + div div span:after{ 75 | content: ''; 76 | display: block; 77 | width: 47%; 78 | height: 2px; 79 | border-radius: 1px; 80 | background: #FFFFFF; 81 | position: absolute; 82 | -webkit-backface-visibility: hidden; 83 | transition: transform 0.5s ease, border-radius 0.3s ease, background 0.4s ease; 84 | } 85 | 86 | #Menu-Icon-Box .Toggle input + div div span:before{ 87 | left: 0; 88 | transform-origin: 0 50%; 89 | transform: translate(1px, 0) scaleX(1.1); 90 | } 91 | 92 | #Menu-Icon-Box .Toggle input + div div span:after{ 93 | right: 0; 94 | transform-origin: 100% 50%; 95 | transform: translate(-1px, 0) scaleX(1.1); 96 | } 97 | 98 | #Menu-Icon-Box .Toggle input + div svg{ 99 | display: block; 100 | fill: none; 101 | stroke: #FFFFFF; 102 | stroke-width: 2px; 103 | width: 44px; 104 | height: 44px; 105 | stroke-linecap: round; 106 | position: absolute; 107 | left: 50%; 108 | top: 50%; 109 | margin: -22px 0 0 -22px; 110 | stroke-dasharray: 0 82.801 8 82.801; 111 | stroke-dashoffset: 82.801; 112 | transform-origin: 50% 50%; 113 | -webkit-backface-visibility: hidden; 114 | transform: scale(1); 115 | transition: stroke-dashoffset 0.5s ease, stroke-dasharray 0.6s ease, transform 0.5s ease, stroke 0.4s ease; 116 | } 117 | 118 | #Menu-Icon-Box .Toggle input + div svg:nth-child(3){ 119 | transform: rotate(180deg) scale(1); 120 | } 121 | 122 | #Menu-Icon-Box .Toggle input:checked + div div{ 123 | transform: rotate(90deg); 124 | } 125 | 126 | #Menu-Icon-Box .Toggle input:checked + div div span:before, #Menu-Icon-Box .Toggle input:checked + div div span:after{ 127 | background: #FFFFFF; 128 | } 129 | 130 | #Menu-Icon-Box .Toggle input:checked + div div span:first-child:before{ 131 | transform: rotate(45deg) translate(2.2px, -3px) scaleX(1.05); 132 | } 133 | 134 | #Menu-Icon-Box .Toggle input:checked + div div span:first-child:after{ 135 | transform: rotate(-45deg) translate(-2.2px, -3px) scaleX(1.05); 136 | } 137 | 138 | #Menu-Icon-Box .Toggle input:checked + div div span:last-child:before{ 139 | transform: rotate(-45deg) translate(2.2px, 3px) scaleX(1.05); 140 | } 141 | 142 | #Menu-Icon-Box .Toggle input:checked + div div span:last-child:after{ 143 | transform: rotate(45deg) translate(-2.2px, 3px) scaleX(1.05); 144 | } 145 | 146 | #Menu-Icon-Box .Toggle input:checked + div svg{ 147 | stroke-dashoffset: 62; 148 | stroke-dasharray: 0 82.801 62 82.801; 149 | transform: rotate(90deg); 150 | stroke: #FFFFFF; 151 | } 152 | 153 | #Menu-Icon-Box .Toggle input:checked + div svg:nth-child(3){ 154 | transform: rotate(270deg); 155 | } -------------------------------------------------------------------------------- /Client/src/Components/Chat/SettingsMenu/SettingsMenu.jsx: -------------------------------------------------------------------------------- 1 | /*** 2 | * Copyright (C) Rodolfo Herrera Hernandez. All rights reserved. 3 | * Licensed under the MIT license. See LICENSE file in the project root 4 | * for full license information. 5 | * 6 | * =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+ 7 | * 8 | * In the vast universe of knowledge, the Open Source philosophy 9 | * shines like a radiant star. In this vein, Lovelace emerges 10 | * as an autonomous alternative to ChatGPT, based on 11 | * open source and self-hosting capabilities. 12 | * 13 | * Written in JavaScript, interacting with the library written 14 | * in Python, allows communication with ChatGPT through the use 15 | * of different services that facilitate its use by the public. 16 | * 17 | * For related information - https://github.com/CodeWithRodi/Lovelace/ 18 | * See also - https://github.com/xtekky/gpt4free 19 | * 20 | * :: https://lovelace.codewithrodi.com/ 21 | * :: https://lovelace-backend.codewithrodi.com/ 22 | * :: https://lovelace-docs.codewithrodi.com/ 23 | * 24 | * =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- 25 | ****/ 26 | 27 | import React, { useContext, useRef } from 'react'; 28 | import { VscClose } from 'react-icons/vsc'; 29 | import { ChatContext } from '../../../Services/Chat/Context'; 30 | import { IconButton, MenuItem } from '@mui/material'; 31 | import { AvailableSettings, RecommendedProviders } from '../../../Services/Chat/Service'; 32 | import { CoreContext } from '../../../Services/Core/Context'; 33 | import Select from '../../General/Select'; 34 | import './SettingsMenu.css'; 35 | 36 | const SettingsMenu = () => { 37 | const SettingsMenuContentBoxReference = useRef(null); 38 | const { Settings, UserExperience } = useContext(ChatContext); 39 | const { L } = useContext(CoreContext); 40 | 41 | return ( 42 | 94 | ); 95 | }; 96 | 97 | export default SettingsMenu; -------------------------------------------------------------------------------- /Client/index.html: -------------------------------------------------------------------------------- 1 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | Lovelace - Decentralizing The AI ​​Industry 68 | 69 | 70 | 75 |
76 | 77 | 78 | -------------------------------------------------------------------------------- /Documentation/docs/Using-The-WS.md: -------------------------------------------------------------------------------- 1 | --- 2 | sidebar_position: 6 3 | hide_table_of_contents: true 4 | slug: /learning-how-to-use-websockets-for-interact-with-the-ai/ 5 | --- 6 | 7 | # Using WebSocket's to establish efficient communication with the AI ​​through the backend. 8 | From the backend server, a WebSocket's server is provided with the help of SocketIO, so it is recommended to use a client provided by the same library, such as `npm i socket.io-client` in the case of NodeJS. It is recommended to use this type of communication if you want an "instantaneous" response, since the response from the AI, unlike using communication via API, you should not wait for the AI ​​to finish processing the response in order to be displayed. . Using WebSocket's the response from the AI ​​is transmitted in parts, generating an interaction with the client instantly. 9 | 10 | ```javascript 11 | const { io } = require('socket.io-client'); 12 | 13 | // Using the NodeJS 'readline' module, like this 14 | // allow to be created by the user 15 | // to our console application. 16 | const ReadLine = require('readline').createInterface({ 17 | input: process.stdin, 18 | output: process.stdout 19 | }); 20 | 21 | // We store the address where the Lovelace backend is mounted. 22 | // In case your instance is running locally 23 | // you can change the value of to something like . 24 | const Endpoint = 'http://lovelace-backend.codewithrodi.com/'; 25 | 26 | (async function(){ 27 | const Socket = io(Endpoint).connect(); 28 | console.log(`Connecting to the server... [${Endpoint}]`); 29 | 30 | Socket.on('connect', () => { 31 | console.log('Connected, happy hacking!'); 32 | RunApplicationLoop(); 33 | }); 34 | 35 | Socket.on('disconnect', () => { 36 | console.log('\nDisconnected, bye bye...!'); 37 | process.exit(0); 38 | }); 39 | 40 | // We use instead of because 41 | // in this way we print directly to the console without each time 42 | // that a part of the response is received, a new line (\n) is executed. 43 | Socket.on('Response', (StreamedAnswer) => process.stdout.write(StreamedAnswer)); 44 | 45 | const BaseQuery = { 46 | // We indicate the model that we want to use to communicate with the AI 47 | // 'GPT-3.5-Turbo' - 'GPT-4' 48 | Model: 'GPT-3.5-Turbo', 49 | // Provider to use in the communication, keep in mind that not all 50 | // providers offer ChatGPT 3.5 or ChatGPT 4. You can make a request 51 | // [GET] to 52 | Provider: 'GetGpt', 53 | Role: 'User', 54 | }; 55 | 56 | const HandleClientPrompt = () => new Promise((Resolve, Reject) => { 57 | const HandleStreamedResponseEnd = (MaybeError) => { 58 | if(MaybeError){ 59 | return Reject(MaybeError); 60 | } 61 | Resolve(); 62 | }; 63 | 64 | ReadLine.question('Prompt > ', (Prompt) => { 65 | // We issue to the server, where as the second parameter 66 | // send the Query to it, specifying the Model, Provider, Role and Prompt. 67 | // The last parameter corresponds to the Callback that will be called 68 | // once the transmission of the response is finished, consider that this 69 | // callback receives a parameter, which corresponds to whether there is an error 70 | // or not during transmission, its content is therefore the error. 71 | Socket.emit('Prompt', { Prompt, ...BaseQuery }, HandleStreamedResponseEnd); 72 | }); 73 | }); 74 | 75 | const RunApplicationLoop = async () => { 76 | while(true){ 77 | await HandleClientPrompt(); 78 | console.log('\n'); 79 | } 80 | }; 81 | })(); 82 | ``` 83 | 84 | ## SocketIO clients to establish communication with the server 85 | 86 | If you want to establish communication with the Lovelace Backend through WebSocket's in another language than the one presented, you can consider: 87 | - [NodeJS Socket.IO Client](https://www.npmjs.com/package/socket.io-client): Realtime application framework (client). 88 | - [Python Socket.IO Client](https://python-socketio.readthedocs.io/en/latest/client.html): The Socket.IO Client. 89 | - [Rust Socket.IO Client](https://crates.io/crates/rust_socketio): An implementation of a socketio client written in rust. 90 | - [C++ Socket.IO Client](https://github.com/socketio/socket.io-client-cpp): C++11 implementation of Socket.IO client. 91 | - [Go Socket.IO Client](https://github.com/hesh915/go-socket.io-client): go-socket.io-client is an client implementation of socket.io in golang, which is a realtime application framework. 92 | - [C# Socket.IO Client](https://github.com/doghappy/socket.io-client-csharp): An elegant socket.io client for .NET, it supports socket.io server v2/v3/v4, and has implemented http polling and websocket. 93 | - [Swift Socket.IO Client](https://github.com/socketio/socket.io-client-swift): Socket.IO-client for iOS/OS X. 94 | - [Dart Socket.IO Client](https://pub.dev/packages/socket_io_client): Port of awesome JavaScript Node.js library - Socket.io-client v2.0.1~v3.0.3 - in Dart. 95 | - [Kotlin Socket.IO Client](https://medium.com/@thushenarriyam/socket-io-connection-on-android-kotlin-to-node-js-server-71b218c160c9): Socket.io Connection on Android Kotlin to Node.js Server. --------------------------------------------------------------------------------