feat: 支持prompt通过配置文件自定义 (#106)

This commit is contained in:
二丫讲梵
2023-03-20 21:13:05 +08:00
committed by GitHub
parent b1392c1c4e
commit 354c42bf85
8 changed files with 82 additions and 32 deletions

View File

@@ -35,7 +35,11 @@ func ProcessRequest(rmsg public.ReceiveMsg) error {
logger.Warning(fmt.Errorf("send message error: %v", err))
}
case "模板":
_, err := rmsg.ReplyText(fmt.Sprintf("%s 您好当前程序内置集成了这些prompt\n====================================\n| #周报 | #前端 | #架构师 | #产品经理 | #网络安全 | #正则 | #招聘 | #知乎 | #翻译 | #小红书 | #解梦 | \n====================================\n你可以选择某个prompt开头然后进行对话。\n以周报为例可发送 #周报 我本周用Go写了一个钉钉集成ChatGPT的聊天应用", rmsg.SenderNick), rmsg.SenderStaffId)
var title string
for _, v := range *public.Prompt {
title = title + v.Title + " | "
}
_, err := rmsg.ReplyText(fmt.Sprintf("%s 您好当前程序内置集成了这些prompt\n====================================\n| %s \n====================================\n你可以选择某个prompt开头然后进行对话。\n以周报为例可发送 #周报 我本周用Go写了一个钉钉集成ChatGPT的聊天应用", rmsg.SenderNick, title), rmsg.SenderStaffId)
if err != nil {
logger.Warning(fmt.Errorf("send message error: %v", err))
}