Releases: pavel-one/EdgeGPT-Go
Releases · pavel-one/EdgeGPT-Go
v1.3.2
What's Changed
- Websocket fix by @pavel-one in #9
- Log level by @pavel-one in #10
New Contributors
- @pavel-one made their first contribution in #9
Full Changelog: v1.3.1...v1.3.2-stable
v1.3.1
Fix conversion styles
Full Changelog: v1.3.0...v1.3.1
v1.3.0
What's Changed
- Fix #4 (add env settings)
- Added new docker image from chat mode
- check nil for message in final.go by @cherryReptile in #1
- using child logger by @cherryReptile in #3
- conversation endoint in env by @cherryReptile in #5
- styles in requests by @cherryReptile in #6
- Cli by @cherryReptile in #2
New Contributors
- @cherryReptile made their first contribution in #1
Full Changelog: v1.2.0...v1.3.0
v1.2.0
v1.1.2
v1.1.0
v1.0.2
EdgeGPT-Go
EdgeGPT-Go is a New Bing unofficial API developed using Golang.
You can use it as a library, microservice or standalone cli application.
The package supports multiple cookies.
The package supports multiple cookies. As well as rapid deployment as a microservice via docker.
Feature:
- GRPC interface
- Library interface
- Sync/Async request
- CLI interface
- Refresh session
How to use it:
Getting authentication (Required)
- Install the cookie editor extension for Chrome or Firefox
- Go to
bing.com
and login - Open the extension
- Click "Export" on the bottom right, then "Export as JSON" (This saves your cookies to clipboard)
- Create folder
cookies
- Paste your cookies into a file
1.json
If you have several accounts - repeat for each of them and save to the cookies
folder
Use as a library
go get github.com/pavel-one/EdgeGPT-Go
package main
import (
"github.com/pavel-one/EdgeGPT-Go/internal/EdgeGPT"
"github.com/pavel-one/EdgeGPT-Go/internal/Logger"
)
var log = Logger.NewLogger("General")
func main() {
s := EdgeGPT.NewStorage()
gpt, err := s.GetOrSet("any-key")
if err != nil {
log.Fatalln(err)
}
// send ask async
mw, err := gpt.AskAsync("Hi, you're alive?")
if err != nil {
log.Fatalln(err)
}
go mw.Worker() // start worker
for _ = range mw.Chan {
// update answer
log.Infoln(mw.Answer.GetAnswer())
log.Infoln(mw.Answer.GetType())
log.Infoln(mw.Answer.GetSuggestions())
log.Infoln(mw.Answer.GetMaxUnit())
log.Infoln(mw.Answer.GetUserUnit())
}
// send sync ask
as, err := gpt.AskSync("Show an example of sockets in golang gorilla")
if err != nil {
log.Fatalln(err)
}
log.Infoln(as.Answer.GetAnswer())
}
Use as a docker microservice
docker run -v ./cookies:/app/cookies -p 8080:8080 ghcr.io/pavel-one/edgegpt-grpc:latest
Use as a docker-compose
version: "3"
services:
gpt:
image: ghcr.io/pavel-one/edgegpt-grpc:latest
restart: unless-stopped
ports:
- "8080:8080"
volumes:
- ./cookies:/app/cookies
Example service
Work progress...