Spaces:
Sleeping
Sleeping
File size: 451 Bytes
395651c | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | """Helpers for OCR preview combined draft (no Pydantic email deps)."""
from __future__ import annotations
from typing import Optional
def build_combined_ocr_preview_draft(user_message: Optional[str], ocr_text: str) -> str:
"""Merge user caption and OCR text for confirm step (user message first, then OCR)."""
u = (user_message or "").strip()
o = (ocr_text or "").strip()
if u and o:
return f"{u}\n\n{o}"
return u or o
|