Skip to content

Commit 15c6e8f

Browse files
committed
fix: Fix folder hierarchy restrictions and add AI models
1 parent 1a380b6 commit 15c6e8f

File tree

4 files changed

+17
-6
lines changed

4 files changed

+17
-6
lines changed

base/src/main/java/com/tinyengine/it/common/enums/Enums.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -793,7 +793,12 @@ public enum FoundationModel {
793793
* Moonshot v1 8k e foundation model.
794794
*/
795795
// kimi
796-
MOONSHOT_V1_8K("moonshot-v1-8k");
796+
MOONSHOT_V1_8K("moonshot-v1-8k"),
797+
/**
798+
* Moonshot v3 e foundation model.
799+
*/
800+
// deepseek
801+
DEEPSEEK_V3("deepseek-chat");
797802
private final String value;
798803

799804
FoundationModel(String value) {

base/src/main/java/com/tinyengine/it/config/AiChatConfig.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
public class AiChatConfig {
2626
private static final String OPENAI_API_URL = "https://api.openai.com";
2727
private static final String LOCAL_GPT_API_URL = "https://dashscope.aliyuncs.com/compatible-mode";
28-
2928
private static final String DEEPSEEK_V3_URL = "https://api.deepseek.com";
3029

3130

@@ -46,14 +45,22 @@ public static Map<String, AiChatConfigData> getAiChatConfig(String model, String
4645
String localGptApiKey = Enums.FoundationModel.LOCAL_GPT.getValue().equals(model) ? token : null;
4746
localGptHeaders.put("Authorization", "Bearer " + localGptApiKey);
4847

48+
Map<String, String> deepSeekHeaders = new HashMap<>();
49+
String deepSeekApiKey = Enums.FoundationModel.DEEPSEEK_V3.getValue().equals(model) ? token : null;
50+
deepSeekHeaders.put("Authorization", "Bearer " + deepSeekApiKey);
51+
4952
Map<String, String> ernieBotHeaders = new HashMap<>();
5053

54+
5155
config.put(Enums.FoundationModel.GPT_35_TURBO.getValue(), new AiChatConfigData(
5256
OPENAI_API_URL + "/v1/chat/completions", createCommonRequestOption(), openaiHeaders, "openai"));
5357

5458
config.put(Enums.FoundationModel.LOCAL_GPT.getValue(), new AiChatConfigData(
5559
LOCAL_GPT_API_URL + "/v1/chat/completions", createCommonRequestOption(), localGptHeaders, "!openai"));
5660

61+
config.put(Enums.FoundationModel.DEEPSEEK_V3.getValue(), new AiChatConfigData(
62+
DEEPSEEK_V3_URL + "/chat/completions", createCommonRequestOption(), deepSeekHeaders, "DeepSeek"));
63+
5764
String ernieBotAccessToken = Enums.FoundationModel.ERNIBOT_TURBO.getValue().equals(model) ? token : null;
5865
config.put(Enums.FoundationModel.ERNIBOT_TURBO.getValue(),
5966
new AiChatConfigData(

base/src/main/java/com/tinyengine/it/model/dto/AiParam.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,12 @@
2626
public class AiParam {
2727
private Map<String, String> foundationModel;
2828
private List<AiMessages> messages;
29+
private String model;
2930

3031
public AiParam(Map<String, String> foundationModel, List<AiMessages> messages) {
3132
this.foundationModel = foundationModel;
3233
this.messages = messages;
34+
this.model = foundationModel.get("model");
3335
}
3436

3537
public AiParam() {

base/src/main/java/com/tinyengine/it/service/app/impl/PageServiceImpl.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -445,10 +445,7 @@ public Result<Integer> getDepth(String parentId) {
445445
// getFolder 获取父类信息
446446
Page parentInfo = pageMapper.queryPageById(parent);
447447
int depth = parentInfo.getDepth();
448-
if (depth < 5) {
449-
return Result.success(depth);
450-
}
451-
return Result.failed("Exceeded depth");
448+
return Result.success(depth);
452449
}
453450

454451
/**

0 commit comments

Comments
 (0)