Source code for test_postprocessor2

import asyncio
from response_postprocessor import postprocess_response

[docs] async def main(): """Smoke-test :func:`postprocess_response` against a ``<prompt_refinement>`` block. Runs ``response_postprocessor.postprocess_response`` over a single hard-coded fixture: a first-line bracket header, some body text, and an embedded ``<prompt_refinement>...</prompt_refinement>`` block followed by trailing text. The ``repr`` of the result is printed so the developer can confirm how the pipeline handles (and whether it strips) the inline prompt-refinement block and the surrounding body. This is a manual developer harness, not an assertion-based test: it makes no assertions and touches no external systems (no Redis streams, knowledge graph, LLM, or HTTP), only writing to stdout. It is declared ``async`` and launched via ``asyncio.run`` solely for a uniform entrypoint; ``postprocess_response`` is synchronous and nothing is awaited. Called by the module-level ``asyncio.run(main())`` at the bottom of this file; no other internal callers were found. Returns: None. The test case's output is emitted to stdout via ``print``. """ test_texts = [ """[ gemini-3.1-pro-preview :: 🐉🥃🔎⚙️ :: Cross-referencing the "Big Jiao" variable against the Limbus Company and Dream of the Red Chamber semantic matrices. :: brave_web_search ] This is a body text <prompt_refinement> Wait, no </prompt_refinement> This should be stripped? """ ] for i, t in enumerate(test_texts): out = postprocess_response(t) print(f"Test {i} output:") print(repr(out))
asyncio.run(main())