Giter Club home page Giter Club logo

chatgpt-clone's Introduction

Development of this repository is currently in a halt, due to lack of time. Updates are comming end of June.

working again ; ) I am very busy at the moment so I would be very thankful for contributions and PR's

To do

ChatGPT Clone

feel free to improve the code / suggest improvements

image

Getting Started

To get started with this project, you'll need to clone the repository and set up a virtual environment. This will allow you to install the required dependencies without affecting your system-wide Python installation.

Prequisites

Before you can set up a virtual environment, you'll need to have Python installed on your system. You can download Python from the official website: https://www.python.org/downloads/

Cloning the Repository

Run the following command to clone the repository:

git clone https://github.com/xtekky/chatgpt-clone.git

Setting up a Virtual Environment

To set up a virtual environment, follow these steps:

  1. Navigate to the root directory of your project.
cd chatgpt-clone
  1. Run the following command to create a new virtual environment:
python -m venv venv
  1. Activate the virtual environment by running the following command:
source venv/bin/activate

If you are using fish shell, the command will be slightly different:

source venv/bin/activate.fish

If you're on Windows, the command will be slightly different:

venv\Scripts\activate
  1. Install the required dependencies by running the following command:
pip install -r requirements.txt

Configure the Application

To configure the application, there are a few properties that can be set either via the environment or via config.json. The environment variable takes priority.

Field Env Variable config.json examples
The OpenAI Api Key OPENAI_API_KEY openai_key sk-...
The OpenAI Base URL OPENAI_API_BASE openai_api_base https://api.openai.com
http://my-reverse-proxy/

Use the Base URL if you need to run your queries through a reverse proxy (like this one which will run your queries through Azure's OpenAI endpoints )

Running the Application

To run the application, make sure the virtual environment is active and run the following command:

python run.py

Docker

The easiest way to run ChatGPT Clone is by using docker

docker-compose up

chatgpt-clone's People

Contributors

3ddelano avatar ahmedosman2001 avatar civitasv avatar dinosaurtirex avatar dracoyus avatar editor-syntax avatar eltociear avatar formalsnake avatar fsantamaria1 avatar haddercone avatar ilyaiskra avatar jackmingo avatar jarvisar avatar jerry-523 avatar junhoyeo avatar mushonnip avatar nemilya avatar philm4 avatar psalias2006 avatar pyhp2017 avatar quartzwarrior avatar sergeypolud avatar xtekky 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  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

chatgpt-clone's Issues

how do i run the server and use the gpt

i did it and it says this
Running on port 1337

  • Serving Flask app 'server.app'
  • Debug mode: off
    WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
  • Running on all addresses (0.0.0.0)
    and then my ip and stuff but how do iuse the clone

Why Open AI Token ?

Initially, its build over the top of gpt4free using some Rev APIs"s to make it free then why are you @xtekky using Open AI Key in Backend it means you are routing from your API Key.

gpt_resp = post('https://api.openai.com/v1/chat/completions', headers = {'Authorization': 'Bearer %s' % self.openai_key}, json = { 'model' : request.json['model'], 'messages' : conversation, 'stream' : True}, stream = True)

Adding a theme picker

As mentioned in the readme, a theme picker addition is required for changing the chat themes.

how i can issue it

{"_action":"_ask","error":"an error occurred string indices must be integers","success":false}

open_api_key Error

I get this error when I try to run the program
self.openai_key = os.environ["OPENAI_API_KEY"] or config['openai_key']
Untitled

Audit usage of navigator.userAgent, navigator.appVersion, and navigator.platform

A page or script is accessing at least one of navigator.userAgent, navigator.appVersion, and navigator.platform. Starting in Chrome 101, the amount of information available in the User Agent string will be reduced.
To fix this issue, replace the usage of navigator.userAgent, navigator.appVersion, and navigator.platform with feature detection, progressive enhancement, or migrate to navigator.userAgentData.
Note that for performance reasons, only the first access to one of the properties is shown.
how to solve this?thank you

some advice

conversions

  • double confirm when delete
  • support output

theme

easy switch black to white.

so slow

So SLOWLY that I don't want to use it.

please...

Remember user preferences

Hi,

Currently, user preferences (like model preference) are not persisted.
I find myself all the time changing it back to my preferred model.

We could store the user's preference on localStorage.

Screenshot 2023-04-21 at 19 28 11

Max retries exceeded with url: /v1/chat/completions

{
  "_action": "_ask",
  "error": "an error occurred HTTPSConnectionPool(host='api.openai.com', port=443): Max retries exceeded with url: /v1/chat/completions (Caused by ProxyError('Cannot connect to proxy.', NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x7fd22fbefeb0>: Failed to establish a new connection: [Errno 111] Connection refused')))",
  "success": false
}

image

When I send message to it, it send this to me

{"_action":"_ask","error":"an error occurred HTTPSConnectionPool(host='api.openai.com', port=443): Max retries exceeded with url: /v1/chat/completions (Caused by SSLError(SSLEOFError(8, 'EOF occurred in violation of protocol (_ssl.c:1131)')))","success":false}

Error occurs

I don't konw why i sent information, it sents"{ "error": { "message": "You exceeded your current quota, please check your plan and billing details.", "type": "insufficient_quota", "param": null, "code": null } }";Can you tell me what happend, thank you so much!!!

Custom OpenAi Parameter's

Hi

its is possible to have the ability to custom the OpenAi API call with those parameters from UI.so we can get granulated response results

Tokens
Temperature
Top_P
Presence Penalty
Frequency Penalty

regards

when executing the command python run.py

when executing the command python run.py
gives an error message :
Traceback (most recent call last):
File "C:\chatgpt-clone\run.py", line 19, in
backend_api = Backend_Api(app, config)
^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\chatgpt-clone\server\backend.py", line 17, in init
self.openai_key = os.environ["OPENAI_API_KEY"] or config['openai_key']
~~~~~~~~~~^^^^^^^^^^^^^^^^^^
File "", line 679, in getitem
KeyError: 'OPENAI_API_KEY'

What should I do ?
openai_key I entered in the file config.json

Error occurred HTTPSConnectionPool

what should i do for this error:

{"_action":"_ask","error":"an error occurred HTTPSConnectionPool(host='ddg-api.herokuapp.com', port=443): Max retries exceeded with url: /search?query=hi&limit=3 (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x0000027A0A0FD210>, 'Connection to ddg-api.herokuapp.com timed out. (connect timeout=None)'))","success":false}

List index out of range

image
selfhosted version
after send message to bot i see in cli message(screenshot)
and bot don't give answer

chatbot.sex is unstable

I got the following error message

{ "error": { "message": "You exceeded your current quota, please check your plan and billing details.", "type": "insufficient_quota", "param": null, "code": null } }

API ERROR

I ALREADY LAUNCHED THE GPT BUT I CANT USE IT, HOW CAN I CHANGE THE API? T.Y

FATAL ERROR

WHEN I TRY TO INSTALL USING: pip install -r requirements.txt

Fatal error in launcher: "Unable to create process using '"C:\Users\flavi\chatgpt-clone\venv\Scripts\python.exe" "C:\WINDOWS\system32\chatgpt-clone\venv\Scripts\pip.exe" install -r requirements.txt': O sistema nÒo pode encontrar o arquivo especificado."

load files in milvus DB

hi

can we have the ability to upload documents to a milvus DB (vector DB) to enhance the bots memories and responses results .

regards

Empty page after docker compose up

After using docker compose up i received following output

chatgpt-clone  | Running on port 1338
chatgpt-clone  |  * Serving Flask app 'server.app'
chatgpt-clone  |  * Debug mode: off
chatgpt-clone  | WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
chatgpt-clone  |  * Running on all addresses (0.0.0.0)
chatgpt-clone  |  * Running on http://127.0.0.1:1338
chatgpt-clone  |  * Running on http://172.18.0.2:1338
chatgpt-clone  | Press CTRL+C to quit

but in all adresses in my browser I get a blank page with message: ERR_CONNECTION_REFUSED
Thank for any help.

Access local file directories

Is there any way to implement file directory access into this when running locally? I am interested in providing the bot with context and pre-existing files to use as a framework.

https://github.com/mayooear/gpt4-pdf-chatbot-langchain enables reading from PDF files, however I wonder if it's possible to provide it with a directory consisting of .txt, .docx, .py, etc files that it can then use as a pre-existing context

Make color picker radio buttons more accessible.

Color picker does not show the color name on hover the radio button. Which makes it harder to select the color.
color labels
There should be a title for each radio button, when user hover over it.

I would love to raise a PR for this.

Support for multiple bot API provider

Hello, is it possible or do you agree if we implement multiple bot engine in this project?
Recently I got API quota limit, so maybe it's better to transparently show which API/ bot provider we use in backend and show the remaining quota per bot and we can manually choose it.
For the user interface, maybe it looks like poe
image

ValueError: invalid literal for int() with base 16: b''

I run with docker. Mac M1, I am seeing this error when response form chatgpt it long.

chatgpt-clone  | Error on request:
chatgpt-clone  | Traceback (most recent call last):
chatgpt-clone  |   File "/root/.local/lib/python3.8/site-packages/urllib3/response.py", line 761, in _update_chunk_length
chatgpt-clone  |     self.chunk_left = int(line, 16)
chatgpt-clone  | ValueError: invalid literal for int() with base 16: b''
chatgpt-clone  | 
chatgpt-clone  | During handling of the above exception, another exception occurred:
chatgpt-clone  | 
chatgpt-clone  | Traceback (most recent call last):
chatgpt-clone  |   File "/root/.local/lib/python3.8/site-packages/urllib3/response.py", line 444, in _error_catcher
chatgpt-clone  |     yield
chatgpt-clone  |   File "/root/.local/lib/python3.8/site-packages/urllib3/response.py", line 828, in read_chunked
chatgpt-clone  |     self._update_chunk_length()
chatgpt-clone  |   File "/root/.local/lib/python3.8/site-packages/urllib3/response.py", line 765, in _update_chunk_length
chatgpt-clone  |     raise InvalidChunkLength(self, line)
chatgpt-clone  | urllib3.exceptions.InvalidChunkLength: InvalidChunkLength(got length b'', 0 bytes read)

Feature request: Scroll while ChatGPT is typing + ChatQueue + Show Result Instantly

Feature requests:

  1. As someone that is impatient, I would like to be able to scroll while ChatGPT is busy typing the next results.
  2. As someone with ADHD, I would like to already write and pass on my next prompt.
  3. As someone that spends too many hours staring at screens, I would like to have the option to have ChatGPT's response appear instantly after a (...loading.. ) screen.

I don't understand how, but many thanks for your gift to this world. May open-source always win.

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.