PHP | CSS | html | Javascript A chat, built on the API for chatgpt from chat.openai.com
OpenAI-GPT-3.5-turbo-simple-script is probably the easiest way to install and host a chat for OpenAI GPT 3.5-turbo and GPT 4 yourself. The script only consists of 4 files (index.php, setsesion.php, stream.php and chat.js). The remaining files are auxiliary files for display (.css) and for extended functionalities (.js)
The php version calls the latest OpenAI interface and the gpt-3.5-turbo model for the Q&A demo, with communication in stream mode and the response speed exceeding that of the official website. The front end uses JS's EventSource, supports Markdown format parsing, and the code has coloring processing. The site's interface is simple and supports contextual continuous sessions.
No framework is used and all PHP versions are supported.
The script can be operated with its own API key (simply change the API_KEY in the stream.php file), or you can let the end users enter an API key (comment out the necessary lines in the index.php file)
Original fork: https://github.com/dirk1983/chatgpt The original script has been localized, checked and adapted.
Install all files on a (protected) web directory. Register for an API key at https://platform.openai.com/.
Paste this key into the stream.php file on line 9. Replace “Your-OpenAI-API” and leave the “”.
If you want to log the chats, make sure the chat.txt file has write permissions (644).
Optionally, you can uncomment lines 3-23 in the index.php file. This would mean that the site would have very rudimentary protection. To do this, enter your IP address in line 3. Choose a username and password. In line 14, replace the word admin with your chosen username at (($_SERVER['PHP_AUTH_USER']=="admin") and the password at ($_SERVER['PHP_AUTH_PW']=="admin").
PHP | CSS | html | Javascript A chat, based on the API for chatgpt from chat.openai.com
OpenAI-GPT-3.5-turbo-simple-script is probably the easiest way to install and host a chat for OpenAI GPT 3.5-turbo and GPT 4 by yourself. The script consists of only 4 files (index.php, setsesion.php, stream.php and chat.js), the rest are auxiliary files for display (.css) and advanced functionality (.js).
The php version calls the latest OpenAI interface and the gpt-3.5-turbo model for the Q&A demo, communicating in stream mode and with response speed exceeding that of the official website. The front-end uses JS's EventSource, supports Markdown format parsing, and the code has coloring processing. The site's user interface is simple and supports contextual continuous sessions.
No framework is used and all PHP versions are supported.
The script can be run with its own API key (just change the API_KEY in the stream.php file), or let the end-users enter an API key (comment out the necessary lines in the index.php file)
Original fork: https://github.com/dirk1983/chatgpt The original script has been localized, checked and adjusted.
Install all files on a (protected) web directory. Register at https://platform.openai.com/ for an API key.
Add this key in the stream.php file in line 9. Replace "Your-OpenAI-API" and leave the "".
If you want to log the chats, make sure that the file chat.txt has write permissions (644).
Optionally, you can uncomment lines 3-23 in the index.php file. This would protect the page in a very rudimentary way. Put your IP address in line 3. Choose a username and a password. Replace in line 14 at (($_SERVER['PHP_AUTH_USER']=="admin") the word admin with your chosen username and at ($_SERVER['PHP_AUTH_PW']=="admin") the password.
March 2023
March 2023
February 2023