openai/config.go

26 lines
507 B
Go
Raw Normal View History

2024-09-07 23:13:36 +08:00
package openai
import (
2024-10-31 15:27:22 +08:00
_ "embed"
2024-09-07 23:13:36 +08:00
2024-10-31 15:27:22 +08:00
"apigo.cc/ai"
"github.com/ssgo/u"
2024-09-07 23:13:36 +08:00
)
2024-10-31 15:27:22 +08:00
//go:embed default.yml
var defaultYml string
2024-09-07 23:13:36 +08:00
func init() {
2024-10-31 15:27:22 +08:00
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,
2024-09-07 23:13:36 +08:00
})
}