diff --git a/src/main/java/com/gpt4/copilot/controller/ChatController.java b/src/main/java/com/gpt4/copilot/controller/ChatController.java index 60f4f1d..d7f45dc 100644 --- a/src/main/java/com/gpt4/copilot/controller/ChatController.java +++ b/src/main/java/com/gpt4/copilot/controller/ChatController.java @@ -380,6 +380,7 @@ public class ChatController { /** * 为每个密钥设置一个专属的machineId + * * @return hexString.toString(); */ private static String generateMachineId() { @@ -556,7 +557,7 @@ public class ChatController { String machineId = generateMachineId(); machineIdList.put(apiKey, machineId); copilotTokenList.put(apiKey, token); - log.info("Github CopilotToken初始化成功!对应的机械码为:"+ machineId); + log.info("Github CopilotToken初始化成功!对应的机械码为:" + machineId); } else { int requestNum = copilotTokenLimitList.get(apiKey).incrementAndGet(); if (requestNum > one_copilot_limit) { @@ -568,7 +569,7 @@ public class ChatController { String chat_token = copilotTokenList.get(apiKey); Map headersMap = new HashMap<>(); //添加头部 - addHeader(headersMap, apiKey, chat_token); + addHeader(headersMap, chat_token, apiKey); String json = com.alibaba.fastjson2.JSON.toJSONString(conversation); RequestBody requestBody = RequestBody.create(json, JSON); Request.Builder requestBuilder = new Request.Builder().url(github_chat_url).post(requestBody); @@ -641,7 +642,7 @@ public class ChatController { String machineId = generateMachineId(); machineIdList.put(apiKey, machineId); coCopilotTokenList.put(apiKey, token); - log.info("coCopilotToken初始化成功!对应的机械码为:"+ machineId); + log.info("coCopilotToken初始化成功!对应的机械码为:" + machineId); } else { int requestNum = coCopilotTokenLimitList.get(apiKey).incrementAndGet(); if (requestNum > one_coCopilot_limit) { @@ -770,7 +771,7 @@ public class ChatController { String machineId = generateMachineId(); machineIdList.put(apiKey, machineId); selfTokenLimitList.put(apiKey, new AtomicInteger(1)); - log.info("自定义selfToken初始化成功!对应的机械码为:"+ machineId); + log.info("自定义selfToken初始化成功!对应的机械码为:" + machineId); } else { int requestNum = selfTokenLimitList.get(apiKey).incrementAndGet(); if (requestNum > one_selfCopilot_limit) { @@ -891,7 +892,7 @@ public class ChatController { String machineId = generateMachineId(); machineIdList.put(apiKey, machineId); copilotTokenList.put(apiKey, token); - log.info("Github CopilotToken初始化成功!对应的机械码为:"+ machineId); + log.info("Github CopilotToken初始化成功!对应的机械码为:" + machineId); } else { int requestNum = copilotTokenLimitList.get(apiKey).incrementAndGet(); if (requestNum > one_copilot_limit) { @@ -992,7 +993,7 @@ public class ChatController { String machineId = generateMachineId(); machineIdList.put(apiKey, machineId); coCopilotTokenList.put(apiKey, token); - log.info("coCopilotToken初始化成功!对应的机械码为:"+ machineId); + log.info("coCopilotToken初始化成功!对应的机械码为:" + machineId); } else { int requestNum = coCopilotTokenLimitList.get(apiKey).incrementAndGet(); if (requestNum > one_coCopilot_limit) { @@ -1072,7 +1073,7 @@ public class ChatController { String machineId = generateMachineId(); machineIdList.put(apiKey, machineId); selfTokenList.put(apiKey, token); - log.info("自定义selfToken初始化成功!对应的机械码为:"+ machineId); + log.info("自定义selfToken初始化成功!对应的机械码为:" + machineId); } else { int requestNum = selfTokenLimitList.get(apiKey).incrementAndGet(); if (requestNum > one_selfCopilot_limit) { @@ -1213,6 +1214,7 @@ public class ChatController { /** * 获取模型 + * * @return */ private Object getModels() { diff --git a/target/classes/com/gpt4/copilot/controller/ChatController.class b/target/classes/com/gpt4/copilot/controller/ChatController.class index 74eb59b..a10fd37 100644 Binary files a/target/classes/com/gpt4/copilot/controller/ChatController.class and b/target/classes/com/gpt4/copilot/controller/ChatController.class differ diff --git a/target/gpt-4-copilot-0.1.2.jar b/target/gpt-4-copilot-0.1.2.jar deleted file mode 100644 index 23467fa..0000000 Binary files a/target/gpt-4-copilot-0.1.2.jar and /dev/null differ diff --git a/target/gpt-4-copilot-0.1.2.jar.original b/target/gpt-4-copilot-0.1.2.jar.original deleted file mode 100644 index c64e3a0..0000000 Binary files a/target/gpt-4-copilot-0.1.2.jar.original and /dev/null differ diff --git a/target/maven-archiver/pom.properties b/target/maven-archiver/pom.properties deleted file mode 100644 index 78d6f8e..0000000 --- a/target/maven-archiver/pom.properties +++ /dev/null @@ -1,3 +0,0 @@ -artifactId=gpt-4-copilot -groupId=com.gpt4.copilot -version=0.1.2