Phase 1.4: 자율 연구 — by-project 엔드포인트 + ResearchPage + 세션 이력
백엔드 (crawler_platform/app/api/routes.py):
- POST /research/run/by-project 추가 — config_path 의존 제거
- ResearchRunByProjectRequest: project_name 기반, DB project.config 재구성
- GraphResearchLoop 동기 실행 (장시간 가능), asdict(result) 반환
- 기존 /projects/{n}/research/sessions, /research/sessions/{job_id}는 변경 없음
프론트엔드 API (src/lib/api/):
- research.ts: researchApi.startByProject/listSessions/getSession + Zod 스키마
- 결과 페이로드는 passthrough() (백엔드 dataclass 그대로 노출)
TanStack Query 훅 (src/hooks/):
- useResearch.ts: useStartResearch, useResearchSessions, useResearchSession
- queryKeys에 research.sessions, research.session 키
ResearchPage 신규 (src/pages/ResearchPage.tsx):
- 2열 레이아웃: 좌측 연구 설정 폼 + 우측 결과/이력
- 폼: 소스 선택, goal 텍스트(필수, 3~500자), 시드 URL(선택),
max_steps/max_branch/max_depth/min_relevance, same_domain_only
react-hook-form + zod 검증
- 결과 카드: 단계/페이지/엔티티/클레임 4종 stats + raw JSON details
- 세션 이력 카드: GET /projects/{n}/research/sessions 결과 리스트
- 실행 중 안내 (장시간 가능), sonner 토스트
라우팅 & Sidebar:
- App.tsx: /research/:projectId 라우트 추가
- AppShell: 사이드바에 "자율 연구" 메뉴 (Brain 아이콘)
i18n: research.*, nav.research 키 (한/영)
다음 단계: Phase 1.5 — 엔티티/클레임 직접 입력
(백엔드 POST /projects/{n}/entities, /claims 신규 필요)
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -8,6 +8,7 @@
|
||||
"onboard": "New Project",
|
||||
"sources": "Sources",
|
||||
"crawl": "Crawl",
|
||||
"research": "Research",
|
||||
"review": "Review",
|
||||
"toggleSidebar": "Toggle sidebar"
|
||||
},
|
||||
@@ -57,6 +58,40 @@
|
||||
"deleted": "Source deleted: {{name}}",
|
||||
"deleteFailed": "Delete failed: {{msg}}"
|
||||
},
|
||||
"research": {
|
||||
"title": "Autonomous Research",
|
||||
"formTitle": "Research Settings",
|
||||
"formDesc": "AI follows links from a seed to autonomously expand the ontology",
|
||||
"source": "Source",
|
||||
"pickSource": "Pick a source...",
|
||||
"goal": "Goal",
|
||||
"goalPlaceholder": "e.g. Collect note compositions and seasonal recommendations of popular perfume brands",
|
||||
"seedUrl": "Seed URL",
|
||||
"optional": "optional",
|
||||
"maxSteps": "Max Steps",
|
||||
"maxBranch": "Branch Width",
|
||||
"maxDepth": "Max Depth",
|
||||
"minRelevance": "Min Relevance",
|
||||
"sameDomainOnly": "Same domain only",
|
||||
"start": "Start Research",
|
||||
"runningHint": "This may take a while. Don't close the page until it finishes.",
|
||||
"runningTitle": "AI is researching...",
|
||||
"completed": "Research completed",
|
||||
"failed": "Failed: {{msg}}",
|
||||
"doneHint": "Done",
|
||||
"idleHint": "Start research on the left to see results here",
|
||||
"resultTitle": "Latest Result",
|
||||
"resultDesc": "Outcome of the research run in this session",
|
||||
"stepsTaken": "Steps",
|
||||
"pagesVisited": "Pages",
|
||||
"entitiesFound": "Entities",
|
||||
"claimsAdded": "Claims",
|
||||
"rawResult": "Raw JSON",
|
||||
"historyTitle": "Session History",
|
||||
"historyDesc": "Past research sessions for this project",
|
||||
"historyEmpty": "No sessions yet",
|
||||
"pages": "pages"
|
||||
},
|
||||
"crawl": {
|
||||
"title": "Seed Crawl",
|
||||
"formTitle": "Crawl Settings",
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
"onboard": "프로젝트 생성",
|
||||
"sources": "참고 소스",
|
||||
"crawl": "크롤 진행",
|
||||
"research": "자율 연구",
|
||||
"review": "결과 검토",
|
||||
"toggleSidebar": "사이드바 토글"
|
||||
},
|
||||
@@ -57,6 +58,40 @@
|
||||
"deleted": "소스가 삭제되었습니다: {{name}}",
|
||||
"deleteFailed": "삭제 실패: {{msg}}"
|
||||
},
|
||||
"research": {
|
||||
"title": "자율 연구",
|
||||
"formTitle": "자율 연구 설정",
|
||||
"formDesc": "AI가 시드에서 시작해 스스로 링크를 따라가며 온톨로지를 확장합니다",
|
||||
"source": "참고 소스",
|
||||
"pickSource": "소스를 선택하세요...",
|
||||
"goal": "목표",
|
||||
"goalPlaceholder": "예: 인기 브랜드 향수의 노트 구성과 시즌 추천 정보 수집",
|
||||
"seedUrl": "시드 URL",
|
||||
"optional": "선택",
|
||||
"maxSteps": "최대 단계",
|
||||
"maxBranch": "분기 폭",
|
||||
"maxDepth": "최대 깊이",
|
||||
"minRelevance": "최소 관련도",
|
||||
"sameDomainOnly": "동일 도메인만 탐색",
|
||||
"start": "자율 연구 시작",
|
||||
"runningHint": "장시간 걸릴 수 있습니다. 완료될 때까지 페이지를 닫지 마세요.",
|
||||
"runningTitle": "AI가 연구 중입니다...",
|
||||
"completed": "자율 연구가 완료되었습니다",
|
||||
"failed": "실패: {{msg}}",
|
||||
"doneHint": "완료",
|
||||
"idleHint": "왼쪽에서 자율 연구를 시작하면 결과가 여기에 표시됩니다",
|
||||
"resultTitle": "최근 결과",
|
||||
"resultDesc": "이번 세션에서 실행된 연구의 결과",
|
||||
"stepsTaken": "단계",
|
||||
"pagesVisited": "페이지",
|
||||
"entitiesFound": "엔티티",
|
||||
"claimsAdded": "클레임",
|
||||
"rawResult": "원시 응답 JSON",
|
||||
"historyTitle": "세션 이력",
|
||||
"historyDesc": "이 프로젝트의 자율 연구 세션 기록",
|
||||
"historyEmpty": "아직 실행된 세션이 없습니다",
|
||||
"pages": "페이지"
|
||||
},
|
||||
"crawl": {
|
||||
"title": "시드 크롤",
|
||||
"formTitle": "크롤 설정",
|
||||
|
||||
Reference in New Issue
Block a user