from pathlib import Path

from jinja2 import Environment, FileSystemLoader, StrictUndefined


def create_prompt_env(prompt_dir: Path, *, trim_blocks: bool = False, lstrip_blocks: bool = False) -> Environment:
    return Environment(  # noqa: S701 — rendering LLM prompts, not HTML
        loader=FileSystemLoader(prompt_dir),
        keep_trailing_newline=True,
        undefined=StrictUndefined,
        trim_blocks=trim_blocks,
        lstrip_blocks=lstrip_blocks,
    )
