dev_该合并了 #8

Merged
yutou merged 83 commits from dev_ into master 2024-01-17 17:23:44 +08:00
2 changed files with 6 additions and 1 deletions
Showing only changes of commit 9b70685949 - Show all commits

View File

@ -30,12 +30,13 @@ public class ApplicationInit implements ApplicationRunner {
if (time.equals(oldTime)) {
return;
}
BaiduGPTManager.getManager().clear();
oldTime = time;
for (Class<?> model : Model.classList) {
new Thread(() -> {
try {
Bot bot = QQBotManager.getInstance().getBot();
if(bot==null){
if (bot == null) {
return;
}
Model useModel = (Model) model.getDeclaredConstructor().newInstance();

View File

@ -63,6 +63,10 @@ public class BaiduGPTManager {
String post = HttpTools.post(url + "?access_token=" + getToken()
, json.toJSONString().getBytes(StandardCharsets.UTF_8));
System.out.println("post = " + post);
if(StringUtils.isEmpty(post)){
clear();
return sendMessage(user, message);
}
ResponseMessage response = JSONObject.parseObject(post, ResponseMessage.class);
messages.add(Message.create(response.getResult(), true));
msgMap.put(user, messages);