文心千帆: https://cloud.baidu.com/product/wenxinworkshop 现在基本申请了就会审核通过
项目地址: https://github.com/anhao/go-ernie
支持接口:
package main
import (
"context"
"fmt"
ernie "github.com/anhao/go-ernie"
)
func main() {
client := ernie.NewDefaultClient("API Key", "Secret Key")
completion, err := client.CreateErnieBotChatCompletion(context.Background(), ernie.ErnieBotRequest{
Messages: []ernie.ChatCompletionMessage{
{
Role: ernie.MessageRoleUser,
Content: "你好呀",
},
},
})
if err != nil {
fmt.Printf("ernie bot error: %v\n", err)
return
}
fmt.Println(completion)
}