feat: document pipeline (embedding->Korean translation->HTML). Add /pipeline/ingest endpoint

This commit is contained in:
hyungi
2025-08-13 08:45:01 +09:00
parent b430a27215
commit a280304adc
3 changed files with 106 additions and 0 deletions

View File

@@ -213,6 +213,22 @@ curl -s -X POST http://localhost:26000/paperless/hook \
해당 훅은 문서 도착을 통지받는 용도로 제공됩니다. 실제 본문 텍스트는 Paperless API로 조회해 `/index/upsert`로 추가하세요.
### Paperless 배치 동기화(`/paperless/sync`)
### 문서 파이프라인(`/pipeline/ingest`)
첨부 문서(텍스트가 준비된 상태: OCR/추출 선행) → 벡터 임베딩 → 한국어 번역 → HTML 생성까지 한 번에 처리합니다.
```bash
curl -s -X POST http://localhost:26000/pipeline/ingest \
-H 'Content-Type: application/json' -H 'X-API-Key: <키>' \
-d '{
"doc_id": "doc-2025-08-13-001",
"text": "(여기에 문서 텍스트)",
"generate_html": true
}'
```
응답에 `html_path`가 포함됩니다. 한국어 번역본이 `outputs/html/<doc_id>.html`로 생성되고, 번역문은 인덱스에 추가되어 RAG로 검색됩니다.
Paperless에서 다수 문서를 일괄 인덱싱합니다.