2023-02-13 10:22:09 +08:00
2023-02-10 13:03:52 +08:00
2023-02-10 13:03:52 +08:00
2023-02-10 13:03:52 +08:00
2023-02-10 13:03:52 +08:00
2023-02-10 13:03:52 +08:00
2023-02-10 14:22:29 +08:00
2023-02-10 13:03:52 +08:00
2023-02-10 13:03:52 +08:00
2023-02-10 18:41:16 +08:00

实时ChatGPT服务

chatGPT-service和chatGPT-stream

gitee传送门

效果图

快速开始

# 拉取代码
git clone https://github.com/cookeem/chatgpt-service.git
cd chatgpt-service

# chatGPT的注册页面: https://beta.openai.com/signup
# chatGPT的注册教程: https://www.cnblogs.com/damugua/p/16969508.html
# chatGPT的APIkey管理界面: https://beta.openai.com/account/api-keys

# 修改config.yaml配置文件修改appKey改为你的openai.com的appKey
vi config.yaml
# openai的appKey改为你的apiKey
appKey: "xxxxxx"


# 使用docker启动服务
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


# 访问页面请保证你的服务器可以访问chatGPT的api接口
# http://localhost:3000

如何编译

# 拉取构建依赖
go mod tidy
# 项目编译
go build

# 执行程序
./chatgpt-service

# 相关接口
# ws://localhost:9000/api/ws/chat

# 安装wscat
npm install -g wscat

# 使用wscat测试websocket然后输入你要查询的问题
wscat --connect ws://localhost:9000/api/ws/chat

Description
Real-time ChatGPT service, support GPT3/GPT4, support conversation and generate pictures from sentences, this is backend
Readme 1.9 MiB
Languages
Go 98.3%
Dockerfile 1.7%