zhipu/config.go
2024-10-31 15:25:04 +08:00

28 lines
572 B
Go

package zhipu
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("zhipu", &ai.Agent{
ChatConfigs: defaultConf.Chat,
EmbeddingConfigs: defaultConf.Embedding,
ImageConfigs: defaultConf.Image,
VideoConfigs: defaultConf.Video,
Chat: Chat,
Embedding: Embedding,
MakeImage: MakeImage,
MakeVideo: MakeVideo,
GetVideoResult: GetVideoResult,
})
}