mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2026-02-06 15:20:22 +00:00
feat(aichat): more compatibility
This commit is contained in:
@@ -10,6 +10,7 @@ import (
|
||||
"unsafe"
|
||||
|
||||
"github.com/fumiama/deepinfra"
|
||||
"github.com/fumiama/deepinfra/model"
|
||||
"github.com/sirupsen/logrus"
|
||||
|
||||
zero "github.com/wdvxdr1123/ZeroBot"
|
||||
@@ -40,7 +41,7 @@ var (
|
||||
)
|
||||
|
||||
var (
|
||||
modelname = "deepseek-ai/DeepSeek-R1"
|
||||
modelname = model.ModelDeepDeek
|
||||
systemprompt = "你正在QQ群与用户聊天,你将收到不同的用户发送的一至多条消息,每条消息以【】包裹的用户名开始,随后是消息内容。按自己的心情简短思考后条理清晰地回复。"
|
||||
sepstr = ""
|
||||
noreplyat = false
|
||||
@@ -121,14 +122,18 @@ func init() {
|
||||
if temp > 100 {
|
||||
temp = 100
|
||||
}
|
||||
data, err := y.Request(chat.Ask(ctx, float32(temp)/100, modelname, systemprompt, sepstr))
|
||||
|
||||
data, err := y.Request(chat.Ask(model.NewOpenAI(
|
||||
modelname, sepstr,
|
||||
float32(temp)/100, 0.9, 4096,
|
||||
), gid, systemprompt))
|
||||
if err != nil {
|
||||
logrus.Warnln("[niniqun] post err:", err)
|
||||
return
|
||||
}
|
||||
txt := strings.Trim(data, "\n ")
|
||||
if len(txt) > 0 {
|
||||
chat.Reply(ctx, txt)
|
||||
chat.Reply(gid, txt)
|
||||
nick := zero.BotConfig.NickName[rand.Intn(len(zero.BotConfig.NickName))]
|
||||
txt = strings.ReplaceAll(txt, "{name}", ctx.CardOrNickName(ctx.Event.UserID))
|
||||
txt = strings.ReplaceAll(txt, "{me}", nick)
|
||||
|
||||
Reference in New Issue
Block a user