chatAI-handler

This commit is contained in:
zhaoyuhang
2023-07-01 13:42:10 +08:00
parent c06934bc89
commit 440159e8a0
20 changed files with 673 additions and 288 deletions

View File

@@ -37,9 +37,14 @@ public class RedisKey {
public static final String USER_SUMMARY_STRING = "userSummary:uid_%d";
/**
* 用户AI聊天次数
* 用户GPT聊天次数
*/
public static final String USER_CHAT_NUM = "userAIChatNum:uid_%d";
public static final String USER_CHAT_NUM = "useChatGPTNum:uid_%d";
/**
* 用户上次使用GLM使用时间
*/
public static final String USER_GLM2_TIME_LAST = "userGLM2UseTime:uid_%d";
public static String getKey(String key, Object... objects) {
return BASE_KEY + String.format(key, objects);

View File

@@ -63,8 +63,13 @@ wx:
secret: ${mallchat.wx.secret} # 公众号的appsecret
token: ${mallchat.wx.token} # 接口配置里的Token值
aesKey: ${mallchat.wx.aesKey} # 接口配置里的EncodingAESKey值
openai:
use-openai: true
ai-user-id: xxxxx
key: xxxxxxx
proxy-url: https://xxxxxxx
chatai:
chatgpt:
use: true
AIUserId: 10450
key: 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
chatglm2:
use: true
url: http://vastmiao.natapp1.cc
minute: 3 # 每个用户每3分钟可以请求一次
AIUserId: 10451