Skip to content

Providing a free OpenAI GPT-4 API ! This is a replication project for the golang version of xtekky/gpt4free

License

Notifications You must be signed in to change notification settings

hugokung/gpt4free-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GPT4FREE-Go 🆓

This project is only used for learning golang.
Cloudflare is the biggest obstacle

⏬ Installation

go get github.com/hugokung/gpt4free-go

💡Usage

Text generation

msg := provider.Messages{
    {"role": "user", "content": "hello, can you help me?"},
}
cli, err := client.Client{}.Create(msg, "gpt-3.5-turbo", "", true, "", 60, "", false, false)
if err != nil {
	return
}

for {
	select {
	case err := <-cli.StreamRespErrCh:
		log.Printf("cli.ErrCh: %v\n", err)
		if errors.Is(err, g4f.ErrStreamRestart) {
			continue
		}
		return
	case data := <-cli.StreamRespCh:
		log.Printf("recv data: %v\n", data.Choices[0].Delta.Content)
	}
}

🚀 TODO

  • Unified API
  • Docker Deployment

🤖 GPT-3.5

Website Provider Stream Status Auth
chatgpt4online.org g4f.provider.Chatgpt4Online ✔️ Active
gpttalk.ru g4f.provider.GptTalkRu ✔️ Unknown
chat10.aichatos.xyz g4f.provider.AiChatOs ✔️ Active

🤖 Other

Website Provider Stream Status Auth
llama2.ai g4f.provider.Llama ✔️ Active

‼️ Declaration

If you do not want your website to appear here, please raise an issue and I will remove it immediately.

About

Providing a free OpenAI GPT-4 API ! This is a replication project for the golang version of xtekky/gpt4free

Resources

License

Stars

Watchers

Forks

Languages