- GRPC interface
- Library interface
- Sync/Async request
- CLI interface
- Refresh session
- Install and open Microsoft Edge browser
- Install Cookie-Editor extension
- Go to New Bing login and getting access
- 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
docker run -it -v ./cookies:/app/cookies ghcr.io/pavel-one/edgegpt-chat
Or download binary in release page
go get github.com/pavel-one/EdgeGPT-Go
package main
import (
"github.com/pavel-one/EdgeGPT-Go"
"log"
)
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.Println(mw.Answer.GetAnswer())
log.Println(mw.Answer.GetType())
log.Println(mw.Answer.GetSuggestions())
log.Println(mw.Answer.GetMaxUnit())
log.Println(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.Println(as.Answer.GetAnswer())
}
docker run -v ./cookies:/app/cookies -p 8080:8080 ghcr.io/pavel-one/edgegpt-grpc:latest
version: "3"
services:
gpt:
image: ghcr.io/pavel-one/edgegpt-grpc:latest
restart: unless-stopped
ports:
- "8080:8080"
volumes:
- ./cookies:/app/cookies
Name | Default | Description |
---|---|---|
CONVERSATION_ENDPOINT |
https://edgeservices.bing.com/edgesvc/turing/conversation/create |
Endpoint for getting conversation |
LOG_LEVEL |
INFO |
Log level. Avalible:
|
Work progress...
If you change protoc file, use protoc --go_out=. --go-grpc_out=. proto/gpt.proto
If you use this library in China set environment:
CONVERSATION_ENDPOINT=https://edge.churchless.tech/edgesvc/turing/conversation/create
Example:
docker run -e CONVERSATION_ENDPOINT=https://edge.churchless.tech/edgesvc/turing/conversation/create -v ./cookies:/app/cookies -p 8080:8080 ghcr.io/pavel-one/edgegpt-grpc:latest
Or docker-compose:
version: "3"
services:
gpt:
image: ghcr.io/pavel-one/edgegpt-grpc:latest
restart: unless-stopped
environment:
- CONVERSATION_ENDPOINT=https://edge.churchless.tech/edgesvc/turing/conversation/create
ports:
- "8080:8080"
volumes:
- ./cookies:/app/cookies