Compare commits

...

6 Commits

Author SHA1 Message Date
李寻欢
4fcf1779de Merge pull request '🎨 页面美化' (#62) from hotfix into main
Reviewed-on: https://gitee.ltd/lxh/go-wxhelper/pulls/62
2024-06-19 14:21:33 +08:00
李寻欢
f39f46bfbf 🎨 页面美化 2024-06-19 14:21:07 +08:00
李寻欢
f946044f13 Merge pull request '🎨 页面美化' (#61) from hotfix into main
Reviewed-on: https://gitee.ltd/lxh/go-wxhelper/pulls/61
2024-06-19 08:42:35 +08:00
李寻欢
5819ac3c04 🎨 页面美化 2024-06-19 08:41:58 +08:00
李寻欢
44b8e4a162 Merge pull request '🐛 Fix a bug.' (#60) from hotfix into main
Reviewed-on: https://gitee.ltd/lxh/go-wxhelper/pulls/60
2024-06-18 17:30:27 +08:00
李寻欢
c4964a9e21 🐛 Fix a bug. 2024-06-18 17:30:05 +08:00
2 changed files with 18 additions and 11 deletions

View File

@@ -48,8 +48,23 @@ func AI(m *plugin.MessageContext) {
// 处理预设角色,默认是配置文件里的,如果数据库配置不为空,则使用数据库配置
prompt := config.Conf.Ai.Personality
var dbPrompt entity.AiAssistant
if friendInfo.Prompt != "" {
prompt = friendInfo.Prompt
// 取出配置的角色
client.MySQL.First(&dbPrompt, "id = ?", friendInfo.Prompt)
if dbPrompt.Id != "" {
prompt = dbPrompt.Personality
}
}
// 配置模型
chatModel := openai.GPT3Dot5Turbo0613
if friendInfo.AiModel != "" {
chatModel = friendInfo.AiModel
} else if dbPrompt.Model != "" {
chatModel = dbPrompt.Model
} else if config.Conf.Ai.Model != "" {
chatModel = config.Conf.Ai.Model
}
// 组装消息体
@@ -101,14 +116,6 @@ func AI(m *plugin.MessageContext) {
Content: m.Content,
})
// 配置模型
chatModel := openai.GPT3Dot5Turbo0613
if friendInfo.AiModel != "" {
chatModel = friendInfo.AiModel
} else if config.Conf.Ai.Model != "" {
chatModel = config.Conf.Ai.Model
}
// 默认使用AI回复
conf := openai.DefaultConfig(config.Conf.Ai.ApiKey)
if config.Conf.Ai.BaseUrl != "" {

View File

@@ -119,7 +119,7 @@
</div>
<!-- 指令 -->
<div class="flex justify-between gap-x-4 py-3 items-center">
<dt class="text-gray-500">迎新</dt>
<dt class="text-gray-500">指令</dt>
<dd class="flex items-start gap-x-2">
{{ template "command" . }}
</dd>
@@ -128,7 +128,7 @@
<div class="flex justify-between gap-x-4 py-3 items-center">
<dt class="text-gray-500">末位淘汰</dt>
<dd class="flex items-start gap-x-2 items-center">
<div class="relative rounded-md shadow-sm">
<div class="relative rounded-md">
<label>
<input type="number" id="auto-cm-{{ .Wxid }}" min="0" class="block w-1/2 float-end rounded-md border-0 py-1.5 text-gray-900 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset focus:ring-indigo-600 sm:text-sm sm:leading-6" placeholder="N天不活跃自动移除"
value="{{.ClearMember}}"