14 Star 194 Fork 113

cookeem / chatgpt-service

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
Clone or Download
contribute
Sync branch
Cancel
Notice: Creating folder will generate an empty file .keep, because not support in Git
Loading...
README
MIT

Real-time ChatGPT service, support GPT3/GPT4, support conversation and generate pictures from sentences

About chatgpt-service and chatgpt-stream

gitee

Demo

  • Real-time conversation mode

  • Generate picture patterns from sentences

Quick start

# 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
  • Enter the question directly, it will call the ChatGPT interface to return the answer
  • Enter the picture description after /image, it will call the DALL-E2 interface to automatically generate pictures through the picture description

How to build

# 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
MIT License Copyright (c) 2022 SeeFlowerX Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

实时ChatGPT服务,支持GPT3/GPT4,支持对话和通过句子生成图片,这是后端服务 expand collapse
Go and 2 more languages
MIT
Cancel

Releases

No release

Contributors

All

Activities

Load More
can not load any more
1
https://gitee.com/cookeem/chatgpt-service.git
git@gitee.com:cookeem/chatgpt-service.git
cookeem
chatgpt-service
chatgpt-service
master

Search