← Files ClaraARCHIVED FILE

modules/set-overlap-analysis/vendor/modules/llm/prompt_helpers.py

498 Bytes · Oct 3, 2026 · 06:30 UTC

↓ Download file

"""Prompt helper stubs for the headless period-comparison chart runtime."""

from __future__ import annotations

from typing import Any

import polars as pl

__all__ = ["clean_df_for_prompt"]


def clean_df_for_prompt(
    dfCopy: pl.DataFrame | pl.LazyFrame, _chartDict: dict[str, Any]
) -> pl.DataFrame:
    """Return a bounded eager frame without importing the app LLM stack."""

    if isinstance(dfCopy, pl.LazyFrame):
        return dfCopy.head(30000).collect()
    return dfCopy.head(30000)

SHA-256: f15b08a346138fc64b662d53905d369a00069ae5c67aa51575371b0915d4006e