feat: pipeline options translate/target_language; allow HTML-only without translation
This commit is contained in:
@@ -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}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user