This project is a ChatGPT clone that allows users to chat with an AI language model trained by OpenAI. It's powered by the github.com/orhanerday/OpenAI php library, which provides an easy-to-use interface for communicating with the OpenAI API.
This project was created to highlight the Stream Example feature of OpenAI GPT-3 Api Client in PHP by Orhan Erday, please don't have too high expectations about the project.
Click here to join the Discord server
Change model at event-stream.php
....
$chat = $open_ai->chat([
'model' => 'gpt-4',
....
Method I
git clone https://github.com/orhanerday/ChatGPT.git
cd ChatGPT
docker build -t chatgpt .
docker run -p 8000:8000 -e OPENAI_API_KEY=sk-o7hL4nCDcjw chatgpt
Method II
docker pull orhan55555/chatgpt
docker run -p 8000:8000 -e OPENAI_API_KEY=sk-o7hL4nCDcjw orhan55555/chatgpt
Before running this project, you should have the following:
Open the php.ini file. This file is usually located in the PHP installation directory.
Find the following line: ;extension=php_sqlite3.dll
Remove the semicolon at the beginning of the line to uncomment it.
Save the file.
Restart the web server.
git clone https://github.com/orhanerday/ChatGPT.git
cd ChatGPT
composer require orhanerday/open-ai
$open_ai_key = "";
php -S localhost:8000 -t .
This project saves chat history using cookies by default. If you want to change this to use authentication instead, you can modify the code in index.php to save chat history in a database or other storage mechanism.
This project is powered by the github.com/orhanerday/OpenAI php library, which provides an easy-to-use interface for communicating with the OpenAI API.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。