GithubHelp home page GithubHelp logo

felixbade / assistant Goto Github PK

View Code? Open in Web Editor NEW
116.0 5.0 24.0 620 KB

Web UI for ChatGPT API. No back-end, mobile-friendly, continuously user-tested

Home Page: https://assistant.bloat.app

License: ISC License

HTML 16.40% JavaScript 48.92% CSS 22.99% Shell 1.51% Python 10.19%
chatgpt chatgpt-api productivity

assistant's Introduction

Assistant – Web UI for ChatGPT API

https://assistant.bloat.app

A mobile-friendly human interface for ChatGPT API. There is no back-end server, so you can easily host your own instance (see details below).

See CHANGELOG.md for what’s new.

🤔 Why API instead of ChatGPT Plus?

  • gpt-3.5-turbo: Cheap token-based cost, instead of flat 20$/mo
  • gpt-4: Unlimited requests (requires early access)
  • No logouts – if OpenAI started revoking API keys weekly, a lot of big SaaS products would get very angry
  • Private – OpenAI’s API policy says your prompts won’t be used for developing, unlike in the playground.

🔩 Features

  • Very polished, mobile-friendly UI
  • PWA support: can be added to the phone’s home screen or installed on your computer as a Chrome app
  • Requests go directly from the browser to OpenAI – no backend server
  • Settings and API key are stored in localStorage
  • Unlimited conversation length by sending only x latest messages to the API (configurable)
  • Markdown rendering
    • Bold, italic
    • Embedded links
    • Code keywords
    • Code blocks
    • Tables
    • Images
    • Horizontal lines
  • Automatic dark/light theme
  • Export the conversation as markdown
  • Screenshot the whole conversation even if it doesn't fit the window
  • Customize the assistant’s behind-the-scenes system message prompt
  • Send follow-up messages even before the previous answer is complete (processed in parallel)
  • Change the model with ctrl+M
  • Open Assistant with an initial prompt if you want to make integrations into other apps. Example: https://assistant.bloat.app/#q=hello%20there

🚚 In the future

  • Search old chats with GPT embeddings (meaning your search words don’t need to be an exact match)
  • Speak your messages using the Whisper API

🔧 Hosting your own version

  • npm install
  • npm run build:prod
  • The bundle will go under dist/. Copy those files somewhere so they show up as a web page (for example GitHub Pages or Nginx).

💙 Contributing

The best way to contribute is by adding feature requests and bug reports to the GitHub issues – you don’t need to be a programmer for that. See CONTRIBUTING.md for details.

assistant's People

Contributors

felixbade avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

assistant's Issues

Fast questions are incorrectly ordered

What I did: entered two questions really fast before the AI had a chance to respond.

Screenshot 2023-03-05 at 23 19 25

I'm expecting both of my messages to be before the responses (like in a chat if I sent two messages quicker than I got an answer for). This is how it should be.

However, I'm also expecting the assistant's responses to be ordered such that the response to the first question is on the top of the two. This is not the case here. They might be ordered by the time of response arrival, but they should be ordered by the time of request sent.

PWA boilerplate

It should be possible to add the app to tge home screen. While not usable without an internet connection, it would be easier to use without browser UI

Add code formatting support

When the answer contains a code snippet add the proper styling around it for readability and easy copy paste.

Animate the "three dots" loading icon

Animating the loading icon lets the user know that something is currently being actively loaded. Static three icons make the user think that nothing is happening, or that the page is frozen (essentially the same thing).

enter key confilct with chinese typewriting

keyCode == 13
will fix this

    textbox.addEventListener('keydown', (event) => {
        if (event.keyCode == 13 && !event.ctrlKey && !event.altKey && !event.shiftKey) {
            event.preventDefault()
            submitMessageForm()
            updateTextareaSize(textbox)
        }
    })

Add prompt history to client

This is quite a big feature, but the prompt + result history could be saved to the client. For example indexedDB. There would need to be a UI to browse old prompts.

Additionally it would be nice to be able to export the history in a hybrid of machine-readable and human readable format. But that’s not strictly needed for this issue.

Improperly escaped messages

https://assistant.bloat.app/#q=how%20to%20style%20%3Cinput%20type%3D%22text%22%3E

What happens:
Screenshot 2023-03-05 at 17 43 55

Expected behavior:
Screenshot 2023-03-05 at 17 46 06

XSS

All user-supplied and AI-supplied content goes through DOMPurify before they are added to the DOM, so this shouldn't be an XSS vector, but this is still not how the app should behave.

Since the script tag is sent to the assistant, it could also make the user feel uneasy whether the script tag ended up to the DOM or not:

https://assistant.bloat.app/#q=%3Cscript%3Ealert()%3C%2Fscript%3E

Screenshot 2023-03-05 at 17 55 14

At the moment the chat API gets the unsanitized text while the UI gets a sanitized one. It is not a security issue (within the scope of this project anyway), since ChatGPT allows unsanitized user input, but it's confusing.

Markdown

&, < and > should be escaped. There's no reason to support any kind of HTML tags in either the user's or the AI's messages – apart from what comes out of the Markdown rendering.

However, Markdown-escaped code renders correctly at the moment, and that shouldn't be broken, since it's important for code examples.

https://assistant.bloat.app/#q=how%20to%20style%20%60%3Cinput%20type%3D%22text%22%3E%60

Now:
Screenshot 2023-03-05 at 18 13 32

Potential fix could break it:
Screenshot 2023-03-05 at 18 30 14

AI content format

The behind-the-scenes conversation with ChatGPT should happen in Markdown (not rendered HTML), but sanitized.

Allow for question in url param

Add possibility to parse question directly from URL params,

url?q="hi chatgpt!"

This would make it faster to open a new conversation from ex alfred or other launcher.

Make code easier to copy

The official ChatGPT web UI makes it really easy to copy individual code blocks by having copy buttons for each. Not sure if that's the way to do it, but copying code blocks should be easier.

Add push to talk

This would add a microphone button to the assistant UI, transcribe the text with Whisper (same API key works for that as well), and then send the text to ChatGPT. I think the original audio doesn't need to be saved, just the transcription is sufficient.

Originally suggested by @smfrue in the transcribe project.

Follow up questions

Make it possible to ask follow up questions and iteratively form a conversation

Sent links are not visible

Not WCAG compatible :D
435E87BA-6EBC-4271-A24B-00C0BAC29BFD
9B8F0EDC-EF0A-473E-8E3C-4988671E7F21

Looking at Signal and Telegram, they have solved this issue by making sent links the same color as normal text and adding an underline. iMessage doesn’t display links at all, only the rich preview.

Signal and Telegram also have an underline in the received links. Telegram uses an accent color for the text where as Signal doesn’t.

Add favicon

The same icon that's used for app icon + rounded corners and transparent background, or something

Move question box down (chat style)

Not sure how to do this so that the vertical position perfectly aligns with the keyboard, but it should be possible, since chat.openai.com does it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.