Skip to content

Latest commit

 

History

History
69 lines (50 loc) · 1.68 KB

README.md

File metadata and controls

69 lines (50 loc) · 1.68 KB

Go-EdgeGPT

Go-EdgeGPT is a New Bing unofficial API developed using Golang. With most chatbot APIs being built on Python, Go-EdgeGPT is unique in its ability to be easily compiled and deployed. It's designed to work seamlessly with your current applications, providing a customizable and reliable chatbot experience.

Setup

go get -u github.com/billikeu/Go-EdgeGPT/edgegpt

Example bot

package main

import (
	"log"

	"github.com/billikeu/Go-EdgeGPT/edgegpt"
)

func callback(answer *edgegpt.Answer) {
	if answer.IsDone() {
		log.Println(answer.NumUserMessages(), answer.MaxNumUserMessages(), answer.Text())
	}
}

func main() {
	log.SetFlags(log.LstdFlags | log.Lshortfile)
	bot := edgegpt.NewChatBot("cookie.json", []map[string]interface{}{}, "http://127.0.0.1:10809")
	err := bot.Init()
	if err != nil {
		panic(err)
	}
	err = bot.Ask("give me a joke", edgegpt.Creative, callback)
	if err != nil {
		panic(err)
	}
	err = bot.Ask("It's not funny", edgegpt.Creative, callback)
	if err != nil {
		panic(err)
	}
}

Others

Star History

Star History Chart

Contributors

This project exists thanks to all the people who contribute.

Reference

Thanks for EdgeGPT