zhipu/config.go

61 lines
1.7 KiB
Go
Raw Permalink Normal View History

2024-09-07 23:14:12 +08:00
package zhipu
import (
2024-10-25 16:04:43 +08:00
"apigo.cc/ai/llm/llm"
"github.com/yankeguo/zhipu"
2024-09-07 23:14:12 +08:00
)
2024-10-25 16:04:43 +08:00
type LLM struct {
config llm.Config
2024-09-07 23:14:12 +08:00
}
var NameMap = map[string]string{
2024-10-25 16:04:43 +08:00
llm.TypeText: zhipu.MultiContentTypeText,
llm.TypeImage: zhipu.MultiContentTypeImageURL,
//llm.TypeVideo: zhipu.MultiContentTypeVideoURL,
llm.RoleSystem: zhipu.RoleSystem,
llm.RoleUser: zhipu.RoleUser,
llm.RoleAssistant: zhipu.RoleAssistant,
llm.RoleTool: zhipu.RoleTool,
2024-09-07 23:14:12 +08:00
}
const (
ModelGLM4Plus = "GLM-4-Plus"
ModelGLM40520 = "GLM-4-0520"
ModelGLM4Long = "GLM-4-Long"
ModelGLM4AirX = "GLM-4-AirX"
ModelGLM4Air = "GLM-4-Air"
ModelGLM4Flash = "GLM-4-Flash"
ModelGLM4AllTools = "GLM-4-AllTools"
ModelGLM4 = "GLM-4"
ModelGLM4VPlus = "GLM-4V-Plus"
ModelGLM4V = "GLM-4V"
ModelCogVideoX = "CogVideoX"
ModelCogView3Plus = "CogView-3-Plus"
ModelCogView3 = "CogView-3"
ModelEmbedding3 = "Embedding-3"
ModelEmbedding2 = "Embedding-2"
ModelCharGLM3 = "CharGLM-3"
ModelEmohaa = "Emohaa"
ModelCodeGeeX4 = "CodeGeeX-4"
)
2024-10-25 16:04:43 +08:00
func (lm *LLM) Support() llm.Support {
return llm.Support{
2024-09-07 23:14:12 +08:00
Ask: true,
AskWithImage: true,
AskWithVideo: true,
AskWithCodeInterpreter: true,
AskWithWebSearch: true,
MakeImage: true,
MakeVideo: true,
Models: []string{ModelGLM4Plus, ModelGLM40520, ModelGLM4Long, ModelGLM4AirX, ModelGLM4Air, ModelGLM4Flash, ModelGLM4AllTools, ModelGLM4, ModelGLM4VPlus, ModelGLM4V, ModelCogVideoX, ModelCogView3Plus, ModelCogView3, ModelEmbedding3, ModelEmbedding2, ModelCharGLM3, ModelEmohaa, ModelCodeGeeX4},
}
}
func init() {
2024-10-25 16:04:43 +08:00
llm.Register("zhipu", func(config llm.Config) llm.LLM {
return &LLM{config: config}
2024-09-07 23:14:12 +08:00
})
}