123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299 |
- <!DOCTYPE html>
- <html lang="en" data-framework="javascript">
- <head>
- <meta charset="UTF-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1.0 maximum-scale=1.0">
- <meta name="description" content="A conversational AI system that listens, learns, and challenges">
- <meta property="og:title" content="ChatGPT">
- <meta property="og:image" content="https://openai.com/content/images/2022/11/ChatGPT.jpg">
- <meta property="og:description" content="A conversational AI system that listens, learns, and challenges">
- <meta property="og:url" content="https://g4f.ai">
- <link rel="stylesheet" href="/static/css/style.css">
- <link rel="stylesheet" href="/static/css/all.min.css">
- <link rel="apple-touch-icon" sizes="180x180" href="/static/img/apple-touch-icon.png">
- <link rel="icon" type="image/png" sizes="32x32" href="/static/img/favicon-32x32.png">
- <link rel="icon" type="image/png" sizes="16x16" href="/static/img/favicon-16x16.png">
- <link rel="manifest" href="/static/img/site.webmanifest">
- <script src="/static/js/highlightjs-copy.min.js"></script>
- <script src="/static/js/chat.v1.js" defer></script>
- <script src="https://cdn.jsdelivr.net/npm/markdown-it@13.0.1/dist/markdown-it.min.js"></script>
- <link rel="stylesheet" href="/static/css/dracula.min.css">
- <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/photoswipe/dist/photoswipe.css">
- <script>
- MathJax = {
- chtml: {
- scale: 1,
- displayAlign: 'left'
- }
- };
- </script>
- <script id="MathJax-script" src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js" async></script>
- <script type="module" src="https://cdn.jsdelivr.net/npm/mistral-tokenizer-js" async>
- import mistralTokenizer from "mistral-tokenizer-js"
- </script>
- <script type="module" src="https://cdn.jsdelivr.net/gh/belladoreai/llama-tokenizer-js@master/llama-tokenizer.js" async>
- import llamaTokenizer from "llama-tokenizer-js"
- </script>
- <script src="https://cdn.jsdelivr.net/npm/gpt-tokenizer/dist/cl100k_base.js" async></script>
- <script src="https://cdn.jsdelivr.net/npm/gpt-tokenizer/dist/o200k_base.js" async></script>
- <script type="module" async>
- import PhotoSwipeLightbox from 'https://cdn.jsdelivr.net/npm/photoswipe/dist/photoswipe-lightbox.esm.js';
- const lightbox = new PhotoSwipeLightbox({
- gallery: '#messages',
- children: 'a:has(img)',
- secondaryZoomLevel: 2,
- pswpModule: () => import('https://cdn.jsdelivr.net/npm/photoswipe'),
- });
- lightbox.addFilter('itemData', (itemData, index) => {
- const img = itemData.element.querySelector('img');
- itemData.width = img.naturalWidth;
- itemData.height = img.naturalHeight;
- return itemData;
- });
- lightbox.on('uiRegister', function() {
- lightbox.pswp.ui.registerElement({
- name: 'custom-caption',
- order: 9,
- isButton: false,
- appendTo: 'root',
- html: 'Caption text',
- onInit: (el, pswp) => {
- lightbox.pswp.on('change', () => {
- const currSlideElement = lightbox.pswp.currSlide.data.element;
- if (currSlideElement) {
- el.innerText = currSlideElement.querySelector('img').getAttribute('alt');
- }
- });
- }
- });
- });
- lightbox.init();
- </script>
- <script>
- const user_image = '<img src="/static/img/user.png" alt="your avatar">';
- const gpt_image = '<img src="/static/img/gpt.png" alt="your avatar">';
- </script>
- <script src="/static/js/highlight.min.js"></script>
- <script>window.conversation_id = "{{chat_id}}"</script>
- <title>g4f - gui</title>
- </head>
- <body>
- <div class="gradient"></div>
- <div class="row">
- <div class="box conversations">
- <div class="top">
- <button class="new_convo" onclick="new_conversation()">
- <i class="fa-regular fa-plus"></i>
- <span>New Conversation</span>
- </button>
- </div>
- <div class="bottom_buttons">
- <button onclick="open_settings();">
- <i class="fa-solid fa-toolbox"></i>
- <span>Open Settings</span>
- </button>
- <div class="info">
- <i class="fa-brands fa-discord"></i>
- <span class="convo-title">discord ~ <a href="https://discord.gg/qXA4Wf4Fsm" target="_blank">discord.gg/qXA4Wf4Fsm</a>
- </span>
- </div>
- <div class="info">
- <i class="fa-brands fa-github"></i>
- <span class="convo-title">github ~ <a href="https://github.com/xtekky/gpt4free" target="_blank">@xtekky/gpt4free</a>
- </span>
- </div>
- <div class="info">
- <i class="fa-solid fa-star"></i>
- <span id="version_text" class="convo-title"></span>
- </div>
- </div>
- </div>
- <div class="settings hidden">
- <div class="paper">
- <h3>Settings</h3>
- <div class="field">
- <span class="label">Enable Dark Mode</span>
- <input type="checkbox" id="darkMode" checked />
- <label for="darkMode" class="toogle" title=""></label>
- </div>
- <div class="field">
- <span class="label">Web Access with DuckDuckGo</span>
- <input type="checkbox" id="switch" />
- <label for="switch" class="toogle" title="Add the pages of the first 5 search results to the query."></label>
- </div>
- <div class="field">
- <span class="label">Disable Conversation History</span>
- <input type="checkbox" id="history" />
- <label for="history" class="toogle" title="To improve the reaction time or if you have trouble with large conversations."></label>
- </div>
- <div class="field">
- <span class="label">Hide System-prompt</span>
- <input type="checkbox" id="hide-systemPrompt" />
- <label for="hide-systemPrompt" class="toogle" title="For more space on phones"></label>
- </div>
- <div class="field">
- <span class="label">Download generated images</span>
- <input type="checkbox" id="download_images" checked/>
- <label for="download_images" class="toogle" title="Download and save generated images to /generated_images"></label>
- </div>
- <div class="field">
- <span class="label">Refine files with spaCy</span>
- <input type="checkbox" id="refine"/>
- <label for="refine" class="toogle" title=""></label>
- </div>
- <div class="field box">
- <label for="systemPrompt" class="label" title="">System prompt</label>
- <textarea id="systemPrompt" placeholder="You are a helpful assistant."></textarea>
- </div>
- <div class="field box">
- <label for="message-input-height" class="label" title="">Input max. height</label>
- <input type="number" id="message-input-height" value="200"/>
- </div>
- <div class="field box">
- <label for="recognition-language" class="label" title="">Speech recognition language</label>
- <input type="text" id="recognition-language" value="" placeholder="navigator.language"/>
- <script>
- document.getElementById('recognition-language').placeholder = navigator.language;
- </script>
- </div>
- <div class="field box">
- <label for="Custom-api_base" class="label" title="">Custom Provider (Base Url):</label>
- <input type="text" id="Custom-api_base" name="Custom[api_base]" placeholder="http://localhost:8080/v1"/>
- </div>
- <div class="field box hidden">
- <label for="Custom-api_key" class="label" title="">Custom Provider:</label>
- <input type="text" id="Custom-api_key" name="Custom[api_key]" placeholder="api_key"/>
- </div>
- <div class="field box hidden">
- <label for="BingCreateImages-api_key" class="label" title="">Microsoft Designer in Bing:</label>
- <input type="text" id="BingCreateImages-api_key" name="BingCreateImages[api_key]" placeholder=""_U" cookie"/>
- </div>
- </div>
- <div class="bottom_buttons">
- <button onclick="delete_conversations()">
- <i class="fa-solid fa-trash"></i>
- <span>Clear Conversations</span>
- </button>
- <button onclick="save_storage()">
- <i class="fa-solid fa-download"></i>
- <a href="" onclick="return false;">Export Conversations</a>
- </button>
- <button id="showLog">
- <i class="fa-solid fa-terminal"></i>
- <a href="" onclick="return false;">Show log</a>
- </button>
- </div>
- </div>
- <div class="provider_forms hidden">
- <div class="bottom_buttons">
- <button id="close_provider_forms">
- <i class="fa-regular fa-circle-xmark"></i>
- <a href="" onclick="return false;">Close</a>
- </button>
- </div>
- </div>
- <div class="conversation">
- <textarea id="chatPrompt" class="box" placeholder="System prompt"></textarea>
- <div id="messages" class="box"></div>
- <button class="slide-systemPrompt">
- <i class="fa-solid fa-angles-up"></i>
- </button>
- <div class="media_player">
- <i class="fa-regular fa-x"></i>
- </div>
- <div class="toolbar">
- <div id="input-count" class="">
- <button class="hide-input">
- <i class="fa-solid fa-angles-down"></i>
- </button>
- <input type="checkbox" id="agree" name="agree" value="yes" checked>
- <label for="agree" class="text" onclick="this.innerText='';">Scroll to bottom</label>
- </div>
- <div class="stop_generating stop_generating-hidden">
- <button id="cancelButton">
- <span>Stop Generating</span>
- <i class="fa-solid fa-stop"></i>
- </button>
- </div>
- <div class="regenerate">
- <button id="regenerateButton">
- <span>Regenerate</span>
- <i class="fa-solid fa-rotate"></i>
- </button>
- </div>
- </div>
- <div class="user-input">
- <div class="box input-box">
- <textarea id="message-input" placeholder="Ask a question" cols="30" rows="10"
- style="white-space: pre-wrap;resize: none;"></textarea>
- <label class="file-label image-label" for="image" title="">
- <input type="file" id="image" name="image" accept="image/*" required multiple/>
- <i class="fa-regular fa-image"></i>
- </label>
- <label class="file-label image-label" for="camera">
- <input type="file" id="camera" name="camera" accept="image/*" capture="camera" required/>
- <i class="fa-solid fa-camera"></i>
- </label>
- <label class="file-label" for="file">
- <input type="file" id="file" name="file" accept=".txt, .html, .xml, .json, .js, .har, .sh, .py, .php, .css, .yaml, .sql, .log, .csv, .twig, .md, .pdf, .docx, .odt, .epub, .xlsx, .zip" required multiple/>
- <i class="fa-solid fa-paperclip"></i>
- </label>
- <label class="micro-label" for="micro">
- <i class="fa-solid fa-microphone-slash"></i>
- </label>
- <div id="send-button">
- <i class="fa-regular fa-paper-plane"></i>
- </div>
- </div>
- </div>
- <div class="buttons">
- <div class="field">
- <button id="search">
- <a href="" onclick="return false;" title="Enable Web Access">
- <i class="fa-solid fa-search"></i>
- </a>
- </button>
- </div>
- <div class="field">
- <select name="model" id="model">
- <option value="">Model: Default</option>
- <option value="gpt-4">gpt-4</option>
- <option value="gpt-4o">gpt-4o</option>
- <option value="gpt-4o-mini">gpt-4o-mini</option>
- <option value="llama-3.1-70b">llama-3.1-70b</option>
- <option value="mixtral-8x7b">mixtral-8x7b</option>
- <option value="claude-3.5-sonnet">claude-3.5-sonnet</option>
- <option value="flux">flux (Image Generation)</option>
- <option value="dall-e-3">dall-e-3 (Image Generation)</option>
- <option disabled="disabled">----</option>
- </select>
- <select name="model2" id="model2" class="hidden"></select>
- </div>
- <div class="field">
- <select name="provider" id="provider">
- <option value="">Provider: Auto</option>
- <option value="OpenaiChat">OpenAI ChatGPT</option>
- <option value="Copilot">Microsoft Copilot</option>
- <option value="Gemini">Google Gemini</option>
- <option value="DDG">DuckDuckGo AI Chat</option>
- <option value="Blackbox">Blackbox AI</option>
- <option disabled="disabled">----</option>
- </select>
- </div>
- <div class="field">
- <button id="pin">
- <i class="fa-solid fa-thumbtack"></i>
- </button>
- </div>
- <div id="pin_container" class="field"></div>
- </div>
- </div>
- <div class="log hidden"></div>
- </div>
- <div class="mobile-sidebar">
- <i class="fa-solid fa-bars"></i>
- </div>
- </body>
- </html>
|