go get github.com/hugokung/gpt4free-go
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)
}
}
- Unified API
- Docker Deployment
Website | Provider | Stream | Status | Auth |
---|---|---|---|---|
chatgpt4online.org | g4f.provider.Chatgpt4Online |
✔️ | ❌ | |
gpttalk.ru | g4f.provider.GptTalkRu |
✔️ | ❌ | |
chat10.aichatos.xyz | g4f.provider.AiChatOs |
✔️ | ❌ |
Website | Provider | Stream | Status | Auth |
---|---|---|---|---|
llama2.ai | g4f.provider.Llama |
✔️ | ❌ |
If you do not want your website to appear here, please raise an issue and I will remove it immediately.