Skip to content
This repository has been archived by the owner on Apr 8, 2024. It is now read-only.

Commit

Permalink
PandoraNext-tokensTool v 0.6.4版本
Browse files Browse the repository at this point in the history
1.新增share_token可直接转入one-api,并可自定义模型重定向
  - 自定义模型重定向:更方便用户backend api使用识图,识文件功能!
2.修复历史问题bug,优化代码
  • Loading branch information
Yanyutin753 committed Jan 10, 2024
1 parent 8dcfb93 commit d20bf4d
Show file tree
Hide file tree
Showing 42 changed files with 43 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ public class shareToken {
*/
private Integer priority;

/**
* 模型重定向
*/
private String model_mapping;

/**
* pool_token 更新时间
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ public List<shareToken> selectShareToken(String name) {
temRes.setOneApi_groups(temNode.has("oneApi_groups") ? temNode.get("oneApi_groups").asText() : "");
//0.5.0
temRes.setOneApi_models(temNode.has("oneApi_models") ? temNode.get("oneApi_models").asText() : "");
temRes.setModel_mapping(temNode.has("model_mapping") ? temNode.get("model_mapping").asText() : "");
temRes.setOneApi_baseUrl(temNode.has("oneApi_baseUrl") ? temNode.get("oneApi_baseUrl").asText() : "");
temRes.setShareTime(temNode.has("shareTime") ? temNode.get("shareTime").asText() : "");
temRes.setPriority(temNode.has("priority") ? temNode.get("priority").asInt() : 0);
Expand Down Expand Up @@ -158,6 +159,7 @@ public String addShareToken(shareToken shareToken) {
newData.put("token_value", shareToken.getToken_value());
newData.put("oneApi_groups", shareToken.getOneApi_groups());
newData.put("oneApi_models", shareToken.getOneApi_models());
newData.put("model_mapping", shareToken.getModel_mapping());
newData.put("oneApi_baseUrl", shareToken.getOneApi_baseUrl());
newData.put("priority", shareToken.getPriority());

Expand Down Expand Up @@ -210,7 +212,7 @@ public boolean addKey(shareToken addKeyPojo, String[] systemSetting) {
jsonObject.put("models", addKeyPojo.getOneApi_models());
String group = addKeyPojo.getOneApi_groups();
jsonObject.put("group", group);
jsonObject.put("model_mapping", "");
jsonObject.put("model_mapping", addKeyPojo.getModel_mapping());
jsonObject.put("groups", new JSONArray().put(group));
// 将JSON对象转换为字符串
String json = jsonObject.toString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,9 @@ public class tokensToolApplication {

public static void main(String[] args) {
log.info("--------------------------------------------------------------\n" +
"PandoraNext-tokensTool v 0.6.3版本\n" +
"1.新增share_token可直接转入one-api\n" +
"2.新增pool_token列表的批量操作\n" +
"3.修改copilot查询模型接口的bug\n" +
"4.修复历史问题bug,优化代码,优化前端\n" +
"PandoraNext-tokensTool v 0.6.4版本\n" +
"1.新增share_token可直接转入one-api,并可自定义模型重定向\n" +
"2.修复历史问题bug,优化代码,优化前端\n" +
"--------------------------------------------------------------\n");
Instant instant = Instant.now();
String key = String.valueOf(instant.toEpochMilli());
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions rearServer/src/main/resources/static/css/390.096719a0.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit d20bf4d

Please sign in to comment.