This is an automated email from the ASF dual-hosted git repository.
wuzhiguo pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/bigtop-manager.git
The following commit(s) were added to refs/heads/main by this push:
new 6bf6279a BIGTOP-4397: Fix resources in the AI module (#197)
6bf6279a is described below
commit 6bf6279a740713ef954289e7ad3199e821900435
Author: haopeng <[email protected]>
AuthorDate: Mon Apr 7 16:24:18 2025 +0800
BIGTOP-4397: Fix resources in the AI module (#197)
---
.../bigtop/manager/ai/assistant/provider/LocSystemPromptProvider.java | 4 ++--
.../src/main/resources/{resources => }/big-data-professor.st | 0
.../src/main/resources/{resources => }/language-prompt-en_US.st | 0
.../src/main/resources/{resources => }/language-prompt-zh_CN.st | 0
4 files changed, 2 insertions(+), 2 deletions(-)
diff --git
a/bigtop-manager-ai/src/main/java/org/apache/bigtop/manager/ai/assistant/provider/LocSystemPromptProvider.java
b/bigtop-manager-ai/src/main/java/org/apache/bigtop/manager/ai/assistant/provider/LocSystemPromptProvider.java
index ad93bc06..4bfb4d94 100644
---
a/bigtop-manager-ai/src/main/java/org/apache/bigtop/manager/ai/assistant/provider/LocSystemPromptProvider.java
+++
b/bigtop-manager-ai/src/main/java/org/apache/bigtop/manager/ai/assistant/provider/LocSystemPromptProvider.java
@@ -53,8 +53,8 @@ public class LocSystemPromptProvider implements
SystemPromptProvider {
private String loadTextFromFile(String fileName) {
try {
- String fullPath =
-
Objects.requireNonNull(ResourceUtils.getFile(fileName)).toString();
+ String fullPath =
Objects.requireNonNull(getClass().getClassLoader().getResource(fileName))
+ .getPath();
File file = ResourceUtils.getFile(fullPath);
return Files.readString(file.toPath(), StandardCharsets.UTF_8);
} catch (IOException | NullPointerException e) {
diff --git
a/bigtop-manager-ai/src/main/resources/resources/big-data-professor.st
b/bigtop-manager-ai/src/main/resources/big-data-professor.st
similarity index 100%
rename from bigtop-manager-ai/src/main/resources/resources/big-data-professor.st
rename to bigtop-manager-ai/src/main/resources/big-data-professor.st
diff --git
a/bigtop-manager-ai/src/main/resources/resources/language-prompt-en_US.st
b/bigtop-manager-ai/src/main/resources/language-prompt-en_US.st
similarity index 100%
rename from
bigtop-manager-ai/src/main/resources/resources/language-prompt-en_US.st
rename to bigtop-manager-ai/src/main/resources/language-prompt-en_US.st
diff --git
a/bigtop-manager-ai/src/main/resources/resources/language-prompt-zh_CN.st
b/bigtop-manager-ai/src/main/resources/language-prompt-zh_CN.st
similarity index 100%
rename from
bigtop-manager-ai/src/main/resources/resources/language-prompt-zh_CN.st
rename to bigtop-manager-ai/src/main/resources/language-prompt-zh_CN.st