Skip to content

billikeu/Go-EdgeGPT

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Go-EdgeGPT: Reverse engineered API of Microsoft's Bing Chat AI. 新必应聊天功能的逆向工程

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages