feat(asl): Complete Deep Research V2.0 core development
Backend: - Add SSE streaming client (unifuncsSseClient) replacing async polling - Add paragraph-based reasoning parser with mergeConsecutiveThinking - Add requirement expansion service (DeepSeek-V3 PICOS+MeSH) - Add Word export service with Pandoc, inline hyperlinks, reference link expansion - Add deep research V2 worker with 2s log flush and Chinese source prompt - Add 5 curated data sources config (PubMed/ClinicalTrials/Cochrane/CNKI/MedJournals) - Add 4 API endpoints (generate-requirement/tasks/task-status/export-word) - Update Prisma schema with 6 new V2.0 fields on AslResearchTask - Add DB migration for V2.0 fields - Simplify ASL_DEEP_RESEARCH_EXPANSION prompt (remove strategy section) Frontend: - Add waterfall-flow DeepResearchPage (phase 0-4 progressive reveal) - Add LandingView, SetupPanel, StrategyConfirm, AgentTerminal, ResultsView - Add react-markdown + remark-gfm for report rendering - Add custom link component showing visible URLs after references - Add useDeepResearchTask polling hook - Add deep research TypeScript types Tests: - Add E2E test, smoke test, and Chinese data source test scripts Docs: - Update ASL module status (v2.0 - core features complete) - Update system status (v6.1 - ASL V2.0 milestone) - Update Unifuncs DeepSearch API guide (v2.0 - SSE mode + Chinese source results) - Update module auth specification (test script guidelines) - Update V2.0 development plan Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -478,6 +478,56 @@ export async function getResearchTaskStatus(
|
||||
return request(`/research/tasks/${taskId}/status`);
|
||||
}
|
||||
|
||||
// ==================== Deep Research V2.0 API ====================
|
||||
|
||||
import type {
|
||||
DataSourceConfig,
|
||||
GenerateRequirementRequest,
|
||||
GenerateRequirementResponse,
|
||||
DeepResearchTask,
|
||||
} from '../types/deepResearch';
|
||||
|
||||
/**
|
||||
* 获取数据源配置列表
|
||||
*/
|
||||
export async function getDeepResearchDataSources(): Promise<ApiResponse<DataSourceConfig[]>> {
|
||||
return request('/research/data-sources');
|
||||
}
|
||||
|
||||
/**
|
||||
* 需求扩写(PICOS + MeSH)
|
||||
*/
|
||||
export async function generateRequirement(
|
||||
data: GenerateRequirementRequest
|
||||
): Promise<ApiResponse<GenerateRequirementResponse>> {
|
||||
return request('/research/generate-requirement', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify(data),
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 启动异步执行
|
||||
*/
|
||||
export async function executeDeepResearchTask(
|
||||
taskId: string,
|
||||
confirmedRequirement: string
|
||||
): Promise<ApiResponse<void>> {
|
||||
return request(`/research/tasks/${taskId}/execute`, {
|
||||
method: 'PUT',
|
||||
body: JSON.stringify({ confirmedRequirement }),
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取 V2.0 任务详情(状态 + 日志 + 结果)
|
||||
*/
|
||||
export async function getDeepResearchTask(
|
||||
taskId: string
|
||||
): Promise<ApiResponse<DeepResearchTask>> {
|
||||
return request(`/research/tasks/${taskId}`);
|
||||
}
|
||||
|
||||
// ==================== 统一导出API对象 ====================
|
||||
|
||||
/**
|
||||
@@ -525,7 +575,13 @@ export const aslApi = {
|
||||
// 健康检查
|
||||
healthCheck,
|
||||
|
||||
// 智能文献检索 (DeepSearch)
|
||||
// 智能文献检索 (DeepSearch V1.x)
|
||||
createResearchTask,
|
||||
getResearchTaskStatus,
|
||||
|
||||
// Deep Research V2.0
|
||||
getDeepResearchDataSources,
|
||||
generateRequirement,
|
||||
executeDeepResearchTask,
|
||||
getDeepResearchTask,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user