AIA V2.0 Major Updates: - Add StreamingService with OpenAI Compatible format (backend/common/streaming) - Upgrade Chat component V2 with Ant Design X deep integration - Implement 12 intelligent agents (5 phases: topic/design/review/data/writing) - Create AgentHub with 100% prototype V11 restoration - Create ChatWorkspace with fullscreen immersive experience - Add ThinkingBlock for deep thinking display - Add useAIStream Hook for stream handling - Add ConversationList for conversation management Backend (~1300 lines): - common/streaming: OpenAI adapter and streaming service - modules/aia: 12 agents config, conversation service, attachment service - Unified API routes to /api/v1 (RVW, PKB, AIA modules) - Update authentication and permission helpers Frontend (~3500 lines): - modules/aia: AgentHub + ChatWorkspace + AgentCard components - shared/Chat: AIStreamChat, ThinkingBlock, useAIStream, useConversations - Update all modules API endpoints to v1 - Modern design with theme colors (blue/yellow/teal/purple) Documentation (~2500 lines): - AIA module status and development guide - Universal capabilities catalog (11 services) - Quick reference card - System overview updates - All module documentation synchronization Other Updates: - DC Tool C: Python operations and frontend components - IIT Manager: session memory and wechat service - PKB/RVW/ASL: API route updates - Docker configs and deployment scripts - Database migrations and scripts - Test files and documentation Tested: AIA streaming verified, authentication working, core features functional Status: AIA V2.0 completed (85%), all changes synchronized
172 lines
4.8 KiB
HTTP
172 lines
4.8 KiB
HTTP
###
|
||
# PKB妯″潡杩佺Щ - API娴嬭瘯鑴氭湰
|
||
# 娴嬭瘯v1鍜寁2璺<EFBFBD>敱鐨勫姛鑳藉畬鏁存€у拰涓€鑷存€?
|
||
###
|
||
|
||
@baseUrl = http://localhost:3000
|
||
@userId = user-mock-001
|
||
|
||
### ============================================
|
||
### 闃舵<EFBFBD>3.1: 鍋ュ悍妫€鏌?
|
||
### ============================================
|
||
|
||
### 1. PKB v2鍋ュ悍妫€鏌?
|
||
GET {{baseUrl}}/api/v1/pkb/health
|
||
Accept: application/json
|
||
|
||
### ============================================
|
||
### 闃舵<EFBFBD>3.2: 鐭ヨ瘑搴揅RUD娴嬭瘯
|
||
### ============================================
|
||
|
||
### 2. 鑾峰彇鐭ヨ瘑搴撳垪琛<EFBFBD>紙v1锛?
|
||
GET {{baseUrl}}/api/v1/knowledge-bases
|
||
Accept: application/json
|
||
|
||
### 3. 鑾峰彇鐭ヨ瘑搴撳垪琛<EFBFBD>紙v2锛?
|
||
GET {{baseUrl}}/api/v1/pkb/knowledge/knowledge-bases
|
||
Accept: application/json
|
||
|
||
### 4. 鍒涘缓鐭ヨ瘑搴擄紙v2锛?
|
||
POST {{baseUrl}}/api/v1/pkb/knowledge/knowledge-bases
|
||
Content-Type: application/json
|
||
|
||
{
|
||
"name": "娴嬭瘯鐭ヨ瘑搴搗2-{{$timestamp}}",
|
||
"description": "杩欐槸涓€涓<EFBFBD>€氳繃v2 API鍒涘缓鐨勬祴璇曠煡璇嗗簱"
|
||
}
|
||
|
||
### 5. 鍒涘缓鐭ヨ瘑搴擄紙v1 - 瀵规瘮锛?
|
||
POST {{baseUrl}}/api/v1/knowledge-bases
|
||
Content-Type: application/json
|
||
|
||
{
|
||
"name": "娴嬭瘯鐭ヨ瘑搴搗1-{{$timestamp}}",
|
||
"description": "杩欐槸涓€涓<EFBFBD>€氳繃v1 API鍒涘缓鐨勬祴璇曠煡璇嗗簱"
|
||
}
|
||
|
||
### 6. 鑾峰彇鐭ヨ瘑搴撹<EFBFBD>鎯咃紙v2锛?
|
||
# 鏇挎崲涓哄疄闄呯殑鐭ヨ瘑搴揑D
|
||
@kbId = f6ebe476-c50f-4222-83d2-c2525edc6054
|
||
GET {{baseUrl}}/api/v1/pkb/knowledge/knowledge-bases/{{kbId}}
|
||
Accept: application/json
|
||
|
||
### 7. 鑾峰彇鐭ヨ瘑搴撹<EFBFBD>鎯咃紙v1 - 瀵规瘮锛?
|
||
GET {{baseUrl}}/api/v1/knowledge-bases/{{kbId}}
|
||
Accept: application/json
|
||
|
||
### 8. 鏇存柊鐭ヨ瘑搴擄紙v2锛?
|
||
PUT {{baseUrl}}/api/v1/pkb/knowledge/knowledge-bases/{{kbId}}
|
||
Content-Type: application/json
|
||
|
||
{
|
||
"name": "鏇存柊鍚庣殑鐭ヨ瘑搴撳悕绉皏2",
|
||
"description": "閫氳繃v2 API鏇存柊鐨勬弿杩?
|
||
}
|
||
|
||
### 9. 鑾峰彇鐭ヨ瘑搴撶粺璁★紙v2锛?
|
||
GET {{baseUrl}}/api/v1/pkb/knowledge/knowledge-bases/{{kbId}}/stats
|
||
Accept: application/json
|
||
|
||
### 10. 鑾峰彇鐭ヨ瘑搴撶粺璁★紙v1 - 瀵规瘮锛?
|
||
GET {{baseUrl}}/api/v1/knowledge-bases/{{kbId}}/stats
|
||
Accept: application/json
|
||
|
||
### ============================================
|
||
### 闃舵<EFBFBD>3.3: RAG妫€绱㈡祴璇?
|
||
### ============================================
|
||
|
||
### 11. RAG妫€绱<EFBFBD>紙v2锛?
|
||
GET {{baseUrl}}/api/v1/pkb/knowledge/knowledge-bases/{{kbId}}/search?query=闃垮皵鍏规捣榛樼棁鐨勬不鐤楁柟娉?top_k=5
|
||
Accept: application/json
|
||
|
||
### 12. RAG妫€绱<EFBFBD>紙v1 - 瀵规瘮锛?
|
||
GET {{baseUrl}}/api/v1/knowledge-bases/{{kbId}}/search?query=闃垮皵鍏规捣榛樼棁鐨勬不鐤楁柟娉?top_k=5
|
||
Accept: application/json
|
||
|
||
### ============================================
|
||
### 闃舵<EFBFBD>3.4: 鏂囨。閫夋嫨锛堝叏鏂囬槄璇绘ā寮忥級
|
||
### ============================================
|
||
|
||
### 13. 鑾峰彇鏂囨。閫夋嫨锛坴2锛?
|
||
GET {{baseUrl}}/api/v1/pkb/knowledge/knowledge-bases/{{kbId}}/document-selection?max_files=7&max_tokens=750000
|
||
Accept: application/json
|
||
|
||
### 14. 鑾峰彇鏂囨。閫夋嫨锛坴1 - 瀵规瘮锛?
|
||
GET {{baseUrl}}/api/v1/knowledge-bases/{{kbId}}/document-selection?max_files=7&max_tokens=750000
|
||
Accept: application/json
|
||
|
||
### ============================================
|
||
### 闃舵<EFBFBD>3.5: 鏂囨。绠$悊娴嬭瘯
|
||
### ============================================
|
||
|
||
### 15. 鑾峰彇鏂囨。鍒楄〃锛堥€氳繃鐭ヨ瘑搴撹<EFBFBD>鎯咃級
|
||
GET {{baseUrl}}/api/v1/pkb/knowledge/knowledge-bases/{{kbId}}
|
||
Accept: application/json
|
||
|
||
### 16. 鑾峰彇鍗曚釜鏂囨。璇︽儏锛坴2锛?
|
||
# 鏇挎崲涓哄疄闄呯殑鏂囨。ID
|
||
@docId = your-document-id
|
||
GET {{baseUrl}}/api/v1/pkb/knowledge/documents/{{docId}}
|
||
Accept: application/json
|
||
|
||
### ============================================
|
||
### 闃舵<EFBFBD>3.6: 鎵瑰<EFBFBD>鐞嗗姛鑳芥祴璇?
|
||
### ============================================
|
||
|
||
### 17. 鑾峰彇鎵瑰<EFBFBD>鐞嗘ā鏉匡紙v2锛?
|
||
GET {{baseUrl}}/api/v1/pkb/batch-tasks/batch/templates
|
||
Accept: application/json
|
||
|
||
### 18. 鍒涘缓鎵瑰<EFBFBD>鐞嗕换鍔★紙v2锛?
|
||
POST {{baseUrl}}/api/v1/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": "娴嬭瘯鎵瑰<EFBFBD>鐞嗕换鍔<EFBFBD>2"
|
||
}
|
||
|
||
### ============================================
|
||
### 闃舵<EFBFBD>3.7: 杈圭晫鏉′欢娴嬭瘯
|
||
### ============================================
|
||
|
||
### 19. 娴嬭瘯涓嶅瓨鍦ㄧ殑鐭ヨ瘑搴擄紙v2锛?
|
||
GET {{baseUrl}}/api/v1/pkb/knowledge/knowledge-bases/00000000-0000-0000-0000-000000000000
|
||
Accept: application/json
|
||
|
||
### 20. 娴嬭瘯鏃犳晥鐨勬煡璇㈠弬鏁帮紙v2锛?
|
||
GET {{baseUrl}}/api/v1/pkb/knowledge/knowledge-bases/{{kbId}}/search?query=&top_k=0
|
||
Accept: application/json
|
||
|
||
### 21. 娴嬭瘯瓒呭ぇtop_k鍙傛暟锛坴2锛?
|
||
GET {{baseUrl}}/api/v1/pkb/knowledge/knowledge-bases/{{kbId}}/search?query=娴嬭瘯&top_k=1000
|
||
Accept: application/json
|
||
|
||
### ============================================
|
||
### 闃舵<EFBFBD>3.8: 娓呯悊娴嬭瘯鏁版嵁锛堝彲閫夛級
|
||
### ============================================
|
||
|
||
### 22. 鍒犻櫎娴嬭瘯鐭ヨ瘑搴擄紙v2锛?
|
||
# @testKbId = 浠庡垱寤哄搷搴斾腑鑾峰彇鐨処D
|
||
DELETE {{baseUrl}}/api/v1/pkb/knowledge/knowledge-bases/{{testKbId}}
|
||
|
||
###
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|