feat: pipeline options translate/target_language; allow HTML-only without translation

This commit is contained in:
hyungi
2025-08-13 08:46:08 +09:00
parent a280304adc
commit 6e7cf8eafa
3 changed files with 24 additions and 10 deletions

View File

@@ -61,6 +61,8 @@ class PipelineIngestRequest(BaseModel):
doc_id: str
text: str
generate_html: bool = True
translate: bool = True
target_language: str = "ko"
@app.get("/health")
@@ -162,7 +164,14 @@ def index_reload() -> Dict[str, Any]:
@app.post("/pipeline/ingest")
def pipeline_ingest(req: PipelineIngestRequest, _: None = Depends(require_api_key)) -> Dict[str, Any]:
result = pipeline.process(doc_id=req.doc_id, text=req.text, index=index, generate_html=req.generate_html)
result = pipeline.process(
doc_id=req.doc_id,
text=req.text,
index=index,
generate_html=req.generate_html,
translate=req.translate,
target_language=req.target_language,
)
return {"status": "ok", "doc_id": result.doc_id, "added": result.added_chunks, "chunks": result.chunks, "html_path": result.html_path}