新增每个密钥对于特定的机器码,一秘钥一机器码,减小被查询异常

This commit is contained in:
Yanyutin753
2024-03-25 23:09:24 +08:00
parent 7b4c00817b
commit 81efd8678e
5 changed files with 9 additions and 10 deletions

View File

@@ -380,6 +380,7 @@ public class ChatController {
/**
* 为每个密钥设置一个专属的machineId
*
* @return hexString.toString();
*/
private static String generateMachineId() {
@@ -568,7 +569,7 @@ public class ChatController {
String chat_token = copilotTokenList.get(apiKey);
Map<String, String> 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);
@@ -1213,6 +1214,7 @@ public class ChatController {
/**
* 获取模型
*
* @return
*/
private Object getModels() {

Binary file not shown.

View File

@@ -1,3 +0,0 @@
artifactId=gpt-4-copilot
groupId=com.gpt4.copilot
version=0.1.2