Files
AIclinicalresearch/backend/test-pkb-migration.http
HaHafeng 5a17d096a7 feat(pkb): Complete PKB module frontend migration with V3 design
Summary:
- Implement PKB Dashboard and Workspace pages based on V3 prototype
- Add single-layer header with integrated Tab navigation
- Implement 3 work modes: Full Text, Deep Read, Batch Processing
- Integrate Ant Design X Chat component for AI conversations
- Create BatchModeComplete with template selection and document processing
- Add compact work mode selector with dropdown design

Backend:
- Migrate PKB controllers and services to /modules/pkb structure
- Register v2 API routes at /api/v2/pkb/knowledge
- Maintain dual API routes for backward compatibility

Technical details:
- Use Zustand for state management
- Handle SSE streaming responses for AI chat
- Support document selection for Deep Read mode
- Implement batch processing with progress tracking

Known issues:
- Batch processing API integration pending
- Knowledge assets page navigation needs optimization

Status: Frontend functional, pending refinement
2026-01-06 22:15:42 +08:00

160 lines
4.8 KiB
HTTP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
###
# PKB - API
# v1v2
###
@baseUrl = http://localhost:3000
@userId = user-mock-001
### ============================================
### 3.1:
### ============================================
### 1. PKB v2
GET {{baseUrl}}/api/v2/pkb/health
Accept: application/json
### ============================================
### 3.2: CRUD
### ============================================
### 2. v1
GET {{baseUrl}}/api/v1/knowledge-bases
Accept: application/json
### 3. v2
GET {{baseUrl}}/api/v2/pkb/knowledge/knowledge-bases
Accept: application/json
### 4. v2
POST {{baseUrl}}/api/v2/pkb/knowledge/knowledge-bases
Content-Type: application/json
{
"name": "v2-{{$timestamp}}",
"description": "v2 API"
}
### 5. v1 -
POST {{baseUrl}}/api/v1/knowledge-bases
Content-Type: application/json
{
"name": "v1-{{$timestamp}}",
"description": "v1 API"
}
### 6. v2
# ID
@kbId = f6ebe476-c50f-4222-83d2-c2525edc6054
GET {{baseUrl}}/api/v2/pkb/knowledge/knowledge-bases/{{kbId}}
Accept: application/json
### 7. v1 -
GET {{baseUrl}}/api/v1/knowledge-bases/{{kbId}}
Accept: application/json
### 8. v2
PUT {{baseUrl}}/api/v2/pkb/knowledge/knowledge-bases/{{kbId}}
Content-Type: application/json
{
"name": "v2",
"description": "v2 API"
}
### 9. v2
GET {{baseUrl}}/api/v2/pkb/knowledge/knowledge-bases/{{kbId}}/stats
Accept: application/json
### 10. v1 -
GET {{baseUrl}}/api/v1/knowledge-bases/{{kbId}}/stats
Accept: application/json
### ============================================
### 3.3: RAG
### ============================================
### 11. RAGv2
GET {{baseUrl}}/api/v2/pkb/knowledge/knowledge-bases/{{kbId}}/search?query=&top_k=5
Accept: application/json
### 12. RAGv1 -
GET {{baseUrl}}/api/v1/knowledge-bases/{{kbId}}/search?query=&top_k=5
Accept: application/json
### ============================================
### 3.4:
### ============================================
### 13. v2
GET {{baseUrl}}/api/v2/pkb/knowledge/knowledge-bases/{{kbId}}/document-selection?max_files=7&max_tokens=750000
Accept: application/json
### 14. v1 -
GET {{baseUrl}}/api/v1/knowledge-bases/{{kbId}}/document-selection?max_files=7&max_tokens=750000
Accept: application/json
### ============================================
### 3.5:
### ============================================
### 15.
GET {{baseUrl}}/api/v2/pkb/knowledge/knowledge-bases/{{kbId}}
Accept: application/json
### 16. v2
# ID
@docId = your-document-id
GET {{baseUrl}}/api/v2/pkb/knowledge/documents/{{docId}}
Accept: application/json
### ============================================
### 3.6:
### ============================================
### 17. v2
GET {{baseUrl}}/api/v2/pkb/batch-tasks/batch/templates
Accept: application/json
### 18. v2
POST {{baseUrl}}/api/v2/pkb/batch-tasks/batch/execute
Content-Type: application/json
{
"kb_id": "{{kbId}}",
"document_ids": [],
"template_type": "preset",
"template_id": "clinical_research_method",
"model_type": "deepseek-v3",
"task_name": "v2"
}
### ============================================
### 3.7:
### ============================================
### 19. v2
GET {{baseUrl}}/api/v2/pkb/knowledge/knowledge-bases/00000000-0000-0000-0000-000000000000
Accept: application/json
### 20. v2
GET {{baseUrl}}/api/v2/pkb/knowledge/knowledge-bases/{{kbId}}/search?query=&top_k=0
Accept: application/json
### 21. top_kv2
GET {{baseUrl}}/api/v2/pkb/knowledge/knowledge-bases/{{kbId}}/search?query=&top_k=1000
Accept: application/json
### ============================================
### 3.8:
### ============================================
### 22. v2
# @testKbId = ID
DELETE {{baseUrl}}/api/v2/pkb/knowledge/knowledge-bases/{{testKbId}}
###