Fetch the repository succeeded.
# Pull source code
git clone https://github.com/cookeem/chatgpt-service.git
cd chatgpt-service
# ChatGPT's registration page: https://beta.openai.com/signup
# ChatGPT registration tutorial: https://www.cnblogs.com/damugua/p/16969508.html
# ChatGPT API key management page: https://beta.openai.com/account/api-keys
# Modify the config.yaml configuration file, modify the apiKey, and change it to your openai.com API key
vi config.yaml
# your openai.com API key
apiKey: "xxxxxx"
# create pictures directory
mkdir -p assets
chown -R 1000:1000 assets
# Start the service with docker-compose
docker-compose up -d
# Check service status
docker-compose ps
Name Command State Ports
-----------------------------------------------------------------------------------------------
chatgpt-service /chatgpt-service/chatgpt-s ... Up 0.0.0.0:59142->9000/tcp
chatgpt-stream /docker-entrypoint.sh ngin ... Up 0.0.0.0:3000->80/tcp,:::3000->80/tcp
# To access the page, please ensure that your server can access the chatGPT API
# http://localhost:3000
/image
, it will call the DALL-E2 interface to automatically generate pictures through the picture description# Pull build dependencies
go mod tidy
# Compile the project
go build
# Run the service
./chatgpt-service
# API url
# ws://localhost:9000/api/ws/chat
# Install wscat
npm install -g wscat
# Use wscat to test websocket, then enter the question you want to query
wscat --connect ws://localhost:9000/api/ws/chat
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
1. Open source ecosystem
2. Collaboration, People, Software
3. Evaluation model