openai/config.go
2024-10-31 15:27:22 +08:00

26 lines
507 B
Go

package openai
import (
_ "embed"
"apigo.cc/ai"
"github.com/ssgo/u"
)
//go:embed default.yml
var defaultYml string
func init() {
defaultConf := ai.AILoadConfig{}
u.Convert(u.UnYamlMap(defaultYml), &defaultConf)
ai.Register("openai", &ai.Agent{
ChatConfigs: defaultConf.Chat,
EmbeddingConfigs: defaultConf.Embedding,
ImageConfigs: defaultConf.Image,
VideoConfigs: defaultConf.Video,
Chat: Chat,
Embedding: Embedding,
MakeImage: MakeImage,
})
}