From 214228542a5e4eccd36c5f9b8175305f8067eb01 Mon Sep 17 00:00:00 2001 From: Danny Avila Date: Fri, 3 Mar 2023 15:52:06 -0500 Subject: [PATCH] complete customChatGpt model selection --- README.md | 15 +-- app/chatgpt-custom.js | 37 ++++++ app/index.js | 2 + app/titleConvo.js | 6 +- package-lock.json | 105 +++++++++++++++++ package.json | 3 + server/routes/ask.js | 42 +++++-- src/components/Messages/Message.jsx | 6 +- src/components/main/ModelMenu.jsx | 166 +++++++++++++++++++++------ src/components/main/SubmitButton.jsx | 3 +- src/components/main/TextChat.jsx | 28 +++-- src/components/ui/AlertDialog.tsx | 156 +++++++++++++++++++++++++ src/components/ui/Dialog.tsx | 144 +++++++++++++++++++++++ src/components/ui/Input.tsx | 24 ++++ src/components/ui/Label.tsx | 21 ++++ src/components/ui/Textarea.tsx | 26 +++++ src/store/submitSlice.js | 15 ++- src/utils/handleSubmit.js | 6 +- 18 files changed, 742 insertions(+), 63 deletions(-) create mode 100644 app/chatgpt-custom.js create mode 100644 src/components/ui/AlertDialog.tsx create mode 100644 src/components/ui/Dialog.tsx create mode 100644 src/components/ui/Input.tsx create mode 100644 src/components/ui/Label.tsx create mode 100644 src/components/ui/Textarea.tsx diff --git a/README.md b/README.md index 72377440d5..49f750cf1a 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ Currently, this project is only functional with the `text-davinci-003` model. > This is a work in progress. I'm building this in public. You can follow the progress here or on my [Linkedin](https://www.linkedin.com/in/danny-avila). -> Here are my planned/recently finished features. +Here are my planned/recently finished features. - [x] Rename, delete conversations - [x] Persistent conversation @@ -43,7 +43,7 @@ Currently, this project is only functional with the `text-davinci-003` model. - [x] Markdown handling - [x] Language Detection for code blocks - [x] 'Copy to clipboard' button for code blocks -- [ ] Set user/model label and prompt prefix view option +- [ ] Customize prompt prefix/label (custom ChatGPT using official API) - [ ] AI model change handling (whether to pseudo-persist convos or start new convos within existing convo) - [ ] Server convo pagination (limit fetch and load more with 'show more' button) - [ ] Bing AI Styling (for suggested responses, convo end, etc.) @@ -58,25 +58,26 @@ Currently, this project is only functional with the `text-davinci-003` model. - Response streaming identical to ChatGPT - UI from original ChatGPT, including Dark mode -- AI model selection +- AI model selection, including OpenAI's official ChatGPT API ### Tech Stack - Utilizes [node-chatgpt-api](https://github.com/waylaidwanderer/node-chatgpt-api) - Response streaming identical to ChatGPT through server-sent events - Use of Tailwind CSS (like the official site) and [shadcn/ui](https://github.com/shadcn/ui) components -- useSWR, Redux Toolkit, Express, MongoDB, [Keyv](https://www.npmjs.com/package/keyv) +- highlight.js, useSWR, Redux, Express, MongoDB, [Keyv](https://www.npmjs.com/package/keyv) ## Use Cases ## ![use case example](./public/use_case.png "GPT is down! Plus is too expensive!") - - ChatGPT is down ( and don't want to pay for ChatGPT Plus). + - One stop shop for all conversational AIs, with the added bonus of searching past conversations. + - Using the official API, you'd have to generate 7.5 million words to expense the same cost as ChatGPT Plus ($20). + - ChatGPT Free is down. - ChatGPT/Google Bard/Bing AI conversations are lost in space or cannot be searched past a certain timeframe. - - Quick one stop shop for all conversational AIs, with the added bonus of searching ## Origin ## - This project was originally created as a Minimum Viable Product (or MVP) for the [@HackReactor](https://github.com/hackreactor/) Bootcamp. It was built with OpenAI response streaming and most of the UI completed in under 20 hours. 20 hours in, I had most of the UI and basic functionality done. This was created without using any boilerplates or templates, including create-react-app and other toolchains. The purpose of the exercise was to learn setting up a full stack project from scratch. Please feel free to give feedback, suggestions, or fork the project for your own use. + This project was originally created as a Minimum Viable Product (or MVP) for the [@HackReactor](https://github.com/hackreactor/) Bootcamp. It was built with OpenAI response streaming and most of the UI completed in under 20 hours. During the end of that time, I had most of the UI and basic functionality done. This was created without using any boilerplates or templates, including create-react-app and other toolchains. I didn't follow any 'un-official chatgpt' video tutorials, and simply referenced the official site for the UI. The purpose of the exercise was to learn setting up a full stack project from scratch. Please feel free to give feedback, suggestions, or fork the project for your own use.