feat(asl): Implement full-text screening core LLM service and validation system (Day 1-3)

Core Components:
- PDFStorageService with Dify/OSS adapters
- LLM12FieldsService with Nougat-first + dual-model + 3-layer JSON parsing
- PromptBuilder for dynamic prompt assembly
- MedicalLogicValidator with 5 rules + fault tolerance
- EvidenceChainValidator for citation integrity
- ConflictDetectionService for dual-model comparison

Prompt Engineering:
- System Prompt (6601 chars, Section-Aware strategy)
- User Prompt template (PICOS context injection)
- JSON Schema (12 fields constraints)
- Cochrane standards (not loaded in MVP)

Key Innovations:
- 3-layer JSON parsing (JSON.parse + json-repair + code block extraction)
- Promise.allSettled for dual-model fault tolerance
- safeGetFieldValue for robust field extraction
- Mixed CN/EN token calculation

Integration Tests:
- integration-test.ts (full test)
- quick-test.ts (quick test)
- cached-result-test.ts (fault tolerance test)

Documentation Updates:
- Development record (Day 2-3 summary)
- Quality assurance strategy (full-text screening)
- Development plan (progress update)
- Module status (v1.1 update)
- Technical debt (10 new items)

Test Results:
- JSON parsing success rate: 100%
- Medical logic validation: 5/5 passed
- Dual-model parallel processing: OK
- Cost per PDF: CNY 0.10

Files: 238 changed, 14383 insertions(+), 32 deletions(-)
Docs: docs/03-涓氬姟妯″潡/ASL-AI鏅鸿兘鏂囩尞/05-寮€鍙戣褰?2025-11-22_Day2-Day3_LLM鏈嶅姟涓庨獙璇佺郴缁熷紑鍙?md
This commit is contained in:
2025-11-22 22:18:17 +08:00
parent 8eef9e0544
commit beb7f7f559
238 changed files with 20718 additions and 31 deletions

View File

@@ -895,3 +895,4 @@ Week 1结束时应达到

View File

@@ -772,3 +772,4 @@ Day 3: 文档更新 4小时

View File

@@ -211,3 +211,4 @@ model Project {

View File

@@ -309,3 +309,4 @@ DROP SCHEMA IF EXISTS st_schema CASCADE;

View File

@@ -135,3 +135,4 @@ ORDER BY nspname;

View File

@@ -153,3 +153,4 @@ FROM platform_schema.users;

View File

@@ -346,3 +346,4 @@ FROM aia_schema.messages;

View File

@@ -419,3 +419,4 @@ FROM pkb_schema.batch_tasks;

View File

@@ -551,3 +551,4 @@ SELECT

View File

@@ -275,3 +275,4 @@ Write-Host "脚本执行完成!" -ForegroundColor Green

View File

@@ -564,3 +564,4 @@ const MyComponent = () => {

View File

@@ -467,3 +467,4 @@ import type { FastifyRequest, FastifyReply } from 'fastify'

View File

@@ -418,3 +418,4 @@ curl http://localhost:3001/api/v1/review

View File

@@ -457,3 +457,4 @@ modules/ ← 新代码,标准化

View File

@@ -251,3 +251,4 @@ Prisma Client在生成时已经读取了每个model的`@@schema()`标签,

View File

@@ -94,3 +94,4 @@

View File

@@ -242,3 +242,4 @@ isExternal?: boolean

View File

@@ -239,3 +239,4 @@ sed -i '1s/^\xEF\xBB\xBF//' file.txt