feat: 完成L09统一文档解析模块与MinerU PDF Provider接入
- 新增 easy-agents-document 聚合、document-core 与 document-pdf 模块 - 接入 MinerU PDF provider,支持同步解析、异步任务与 ZIP 结果映射 - 移除 easy-agents-rag-ocr 空壳并补齐 starter 自动装配
This commit is contained in:
@@ -56,6 +56,11 @@
|
||||
<artifactId>easy-agents-rag-core</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.easyagents</groupId>
|
||||
<artifactId>easy-agents-document-pdf</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.easyagents</groupId>
|
||||
<artifactId>easy-agents-rag-ingestion</artifactId>
|
||||
|
||||
@@ -8,3 +8,4 @@ com.easyagents.spring.boot.store.chroma.ChromaAutoConfiguration
|
||||
com.easyagents.spring.boot.store.elasticsearch.ElasticSearchAutoConfiguration
|
||||
com.easyagents.spring.boot.store.opensearch.OpenSearchAutoConfiguration
|
||||
com.easyagents.spring.boot.rag.ingestion.RagIngestionAutoConfiguration
|
||||
com.easyagents.spring.boot.document.pdf.mineru.MineruPdfAutoConfiguration
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
package com.easyagents.spring.boot.autoconfigure;
|
||||
|
||||
import com.easyagents.document.core.DocumentParseService;
|
||||
import com.easyagents.document.pdf.PdfDocumentParseService;
|
||||
import com.easyagents.llm.ollama.OllamaChatModel;
|
||||
import com.easyagents.spring.boot.document.pdf.mineru.MineruPdfAutoConfiguration;
|
||||
import com.easyagents.spring.boot.llm.ollama.OllamaAutoConfiguration;
|
||||
import com.easyagents.spring.boot.rag.ingestion.RagIngestionAutoConfiguration;
|
||||
import com.easyagents.spring.boot.store.opensearch.OpenSearchAutoConfiguration;
|
||||
@@ -11,7 +14,12 @@ import org.springframework.boot.test.context.runner.ApplicationContextRunner;
|
||||
public class StarterConditionalAutoConfigurationTest {
|
||||
|
||||
private final ApplicationContextRunner contextRunner = new ApplicationContextRunner()
|
||||
.withUserConfiguration(RagIngestionAutoConfiguration.class, OllamaAutoConfiguration.class, OpenSearchAutoConfiguration.class);
|
||||
.withUserConfiguration(
|
||||
RagIngestionAutoConfiguration.class,
|
||||
OllamaAutoConfiguration.class,
|
||||
OpenSearchAutoConfiguration.class,
|
||||
MineruPdfAutoConfiguration.class
|
||||
);
|
||||
|
||||
@Test
|
||||
public void shouldNotCreateOptionalBeansWithoutExplicitProperties() {
|
||||
@@ -19,6 +27,8 @@ public class StarterConditionalAutoConfigurationTest {
|
||||
Assert.assertTrue(context.containsBean("ragIngestionService"));
|
||||
Assert.assertFalse(context.containsBean("ollamaLlm"));
|
||||
Assert.assertFalse(context.containsBean("openSearchVectorStore"));
|
||||
Assert.assertFalse(context.containsBean("pdfDocumentParseService"));
|
||||
Assert.assertFalse(context.containsBean("documentParseService"));
|
||||
});
|
||||
}
|
||||
|
||||
@@ -28,4 +38,17 @@ public class StarterConditionalAutoConfigurationTest {
|
||||
.withPropertyValues("easy-agents.llm.ollama.model=qwen3:8b")
|
||||
.run(context -> Assert.assertNotNull(context.getBean(OllamaChatModel.class)));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shouldCreateMineruDocumentBeansWhenConfigured() {
|
||||
contextRunner
|
||||
.withPropertyValues(
|
||||
"easy-agents.document.pdf.provider=mineru",
|
||||
"easy-agents.document.pdf.mineru.base-url=https://hub.wust.edu.cn/modelServer/mineru-api"
|
||||
)
|
||||
.run(context -> {
|
||||
Assert.assertNotNull(context.getBean(PdfDocumentParseService.class));
|
||||
Assert.assertNotNull(context.getBean(DocumentParseService.class));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user