Socket
Book a DemoInstallSign in
Socket

github.com/yoak3n/EdgeGPT-http

Package Overview
Dependencies
Alerts
File Explorer
Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

github.com/yoak3n/EdgeGPT-http

v0.0.6
Source
Go
Version published
Created
Source

EdgeGPT-http

a http server based on go

just a practice work for self-entertainment.

Download

git clone https://github.com/Yoak3n/EdgeGPT-http.git

or

Download ZIP

Usage

Basic(manually)

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 namemeans 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 and cookies.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  

Problem

  • multiple sessions
  • commands for conversation like resetor more
  • source auto release
  • high concurrency(perhaps gin already supported)

Reference

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

FAQs

Package last updated on 11 May 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.