just a practice work for self-entertainment.
git clone https://github.com/Yoak3n/EdgeGPT-http.git
or
Find the configuration file config.example.yaml
and rename it as config.yaml
, then modify the configuration inside.
- Start the service by using the following command:
go run .\main.go
- Client post to
url/chat
with a json data like the following:
{
"name": "test",
"style": "bing-c",
"question": "hello bing"
}
One name
means one conversation
Then the client will get a json response:
{
"status": "success",
"style": "bing-c",
"message": "bing's answer",
"count": {
"currentNum":1,
"maxNum":20
}
}
Docker
Must installed Docker
- Pull the image by:
docker pull yoaken/edgegpt-http:latest
2.Run the image:
docker run -v 'your absolute path of config.yml:/app/config.yml' -v'your absolute path of cookies.json:/app/cookies.json' -p "8080:8080" yoaken/edgegpt-http:latest
docker-compose(recommended)
Must installed Docker
and docker-compose
- Copy the file
docker-compose.yml
to the dir path as you like - Create your
config.yml
andcookies.json
in the path the same to the above - Change the work dir where these files exist and run with a single command:
docker-compose up -d
- multiple sessions
- commands for conversation like
reset
or more - source auto release
- high concurrency(perhaps
gin
already supported)
At the very beginning I use the Python lib EdgeGPT in my bing-qqbot,it's too complicated to start.So I planed to convert it to golang at some point,however thank billikeu that his repository Go-EdgeGPT really helped me(btw my plan is also named go-EdgeGPT
)XD
For the convenience of development, it is temporarily included as part of this project, and may be submitted as a PR in the future
And the idea came from the http service of chatgpt-mirai-qq-bot