添加千帆大模型支持

This commit is contained in:
junleea 2025-05-10 15:27:56 +08:00
parent 6ee679f29e
commit 2e02bd22a1
1 changed files with 3 additions and 3 deletions

View File

@ -16,12 +16,12 @@ import (
func Qianfan(modelParam proto.ModelParam, imCtx *proto.IMParamContext) {
log.Println("qianfan model param:", modelParam)
log.Println("qianfan question:", imCtx.Question)
if modelParam.AccessKey == "" || modelParam.APISecret == "" {
log.Println("qianfan AccessKey or APISecret is empty")
if modelParam.AccessKey == "" || modelParam.SecretKey == "" {
log.Println("qianfan AccessKey or SecretKey is empty")
return
}
qianfan.GetConfig().AccessKey = modelParam.AccessKey
qianfan.GetConfig().SecretKey = modelParam.APISecret
qianfan.GetConfig().SecretKey = modelParam.SecretKey
chat := qianfan.NewChatCompletion(qianfan.WithModel(modelParam.Model))
var messages []qianfan.ChatCompletionMessage