Skip to content

ontocast.prompt.section_classification

Prompt templates for section classification during chunk prepare.

document_type_context(document_type)

Optional human-message prefix when the caller supplies a document type hint.

Source code in ontocast/prompt/section_classification.py
def document_type_context(document_type: str | None) -> str:
    """Optional human-message prefix when the caller supplies a document type hint."""
    if document_type is None:
        return ""
    stripped = document_type.strip()
    if not stripped:
        return ""
    return f"Optional context — the source material is described as: {stripped}.\n\n"