[app-platform] Add open source knowledge repo impl.#564
Merged
loveTsong merged 5 commits intoModelEngine-Group:1.3.xfrom Feb 6, 2026
Merged
Conversation
Member
|
里程碑和目标分支不匹配 |
Contributor
Author
fix |
desAweis
reviewed
Dec 24, 2025
| /** | ||
| * 返回前多少的条目。 | ||
| */ | ||
| @Property(description = "topK", name = "topK") |
| @Property(description = "topK", name = "topK") | ||
| private Integer topK; | ||
| /** | ||
| * 相关性阈值。 |
...wledge/src/main/java/modelengine/fit/jade/datamate/knowledge/dto/DataMateRetrievalParam.java
Show resolved
Hide resolved
| * 知识库描述。 | ||
| */ | ||
| private String description; | ||
| /** |
| private String createdAt; | ||
| /** | ||
| * 知识库更新时间。 | ||
| */ |
| package modelengine.fit.jade.datamate.knowledge.knowledge.entity; | ||
|
|
||
| import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
|
|
|
|
||
| import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | ||
|
|
||
| import lombok.Data; |
|
|
||
| import lombok.Builder; | ||
| import lombok.Data; | ||
|
|
| private final HttpClassicClientFactory httpClientFactory; | ||
| private final LazyLoader<HttpClassicClient> httpClient; | ||
| private final Map<Integer, KnowledgeManagerRetCode> exceptionMap = new HashMap<>(); | ||
|
|
|
|
||
| private final DataMateKnowledgeBaseManager knowledgeBaseManager; | ||
| private final KnowledgeI18nService knowledgeI18nService; | ||
|
|
reeeborn33
reviewed
Dec 24, 2025
| DataMateResponse.from(response, DataMateKnowledgeListEntity.class); | ||
| return Validation.notNull(resp.getData(), "The response body is abnormal."); | ||
| } catch (ClientException ex) { | ||
| log.error(QUERY_KNOWLEDGE_LIST_ERROR.getMsg(), ex.getMessage()); |
reeeborn33
reviewed
Dec 24, 2025
| return Validation.notNull(resp.getData(), "The response body is abnormal."); | ||
| } catch (ClientException ex) { | ||
| log.error(QUERY_KNOWLEDGE_LIST_ERROR.getMsg(), ex.getMessage()); | ||
| throw new KnowledgeException(QUERY_KNOWLEDGE_LIST_ERROR, ex.getMessage()); |
Contributor
There was a problem hiding this comment.
建议在抛出 KnowledgeException时也尽量保留原始异常信息,保留cause
loveTsong
reviewed
Feb 6, 2026
| - 'modelengine.fit.jade.datamate.knowledge' | ||
| datamate: | ||
| url: | ||
| list: 'https://datamate.dallas98.top:30000/api/knowledge-base/list' |
Contributor
loveTsong
reviewed
Feb 6, 2026
| * Licensed under the MIT License. See License.txt in the project root for license information. | ||
| *--------------------------------------------------------------------------------------------*/ | ||
|
|
||
| package modelengine.fit.jade.datamate.knowledge.knowledge.service; |
Contributor
loveTsong
reviewed
Feb 6, 2026
| * @since 2025-12-15 | ||
| */ | ||
| @Component | ||
| public class DataMateKnowledgeRepoServiceImpl implements KnowledgeRepoService { |
loveTsong
reviewed
Feb 6, 2026
| HttpClassicClientRequest request = | ||
| this.httpClient.get().createRequest(HttpRequestMethod.POST, this.dataMateUrls.get("list")); | ||
| request.entity(Entity.createObject(request, param)); | ||
| request.headers().set(AUTHORIZATION, BEARER + apiKey); |
Contributor
loveTsong
reviewed
Feb 6, 2026
| HttpClassicClientRequest request = | ||
| this.httpClient.get().createRequest(HttpRequestMethod.POST, this.dataMateUrls.get("retrieve")); | ||
| request.entity(Entity.createObject(request, param)); | ||
| request.headers().set(AUTHORIZATION, BEARER + apiKey); |
Contributor
There was a problem hiding this comment.
上层允许apiKey为空,这里建议为空或null时不传入 该鉴权header,这样更加符合使用规范。
loveTsong
reviewed
Feb 6, 2026
| return new KnowledgeException(this.exceptionMap.get(statusCode), ex, ex.getSimpleMessage()); | ||
| } | ||
|
|
||
| private HttpClassicClient getHttpClient() { |
Contributor
loveTsong
previously approved these changes
Feb 6, 2026
loveTsong
approved these changes
Feb 6, 2026
Closed
4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.






🔗 相关问题 / Related Issue
Issue 链接 / Issue Link: #563
📋 变更类型 / Type of Change
📝 变更目的 / Purpose of the Change
适配DataMate的知识库接口,提供新的知识库实现
📋 主要变更 / Brief Changelog
🧪 验证变更 / Verifying this Change
测试步骤 / Test Steps
测试覆盖 / Test Coverage
📸 截图 / Screenshots
✅ 贡献者检查清单 / Contributor Checklist
请确保你的 Pull Request 符合以下要求 / Please ensure your Pull Request meets the following requirements:
基本要求 / Basic Requirements:
代码质量 / Code Quality:
测试要求 / Testing Requirements:
mvn -B clean package -Dmaven.test.skip=true,npm install --force && npm run build:pro/ Basic checks passmvn clean install/ Unit tests pass文档和兼容性 / Documentation and Compatibility:
📋 附加信息 / Additional Notes
审查者注意事项 / Reviewer Notes: