Skip to content

build_manual_governance_prompt_package

Public callable

Build copy/paste prompt package for manual governance suggestion generation.

Parameters:

Name Type Description Default
sample_rows Any

Optional small sample context serialized compactly for prompt ferry usage.

None
business_context str

Static context embedded in prompt text.

''
dataset_name str | None

Static dataset name embedded in prompt text.

None

Returns:

Type Description
dict

Manual package containing reusable prompt text, schema expectations, and notes. Output is advisory and requires human review.

Source code in src/fabricops_kit/ai.py
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
def build_manual_governance_prompt_package(sample_rows=None, business_context="", dataset_name=None, config: FrameworkConfig | None = None) -> dict:
    """Build copy/paste prompt package for manual governance suggestion generation.

    Parameters
    ----------
    sample_rows : Any, optional
        Optional small sample context serialized compactly for prompt ferry usage.
    business_context : str, optional
        Static context embedded in prompt text.
    dataset_name : str | None, optional
        Static dataset name embedded in prompt text.

    Returns
    -------
    dict
        Manual package containing reusable prompt text, schema expectations, and
        notes. Output is advisory and requires human review.
    """
    prompt = build_governance_candidate_prompt(business_context=business_context, dataset_name=dataset_name, config=config)
    compact = _compact_sample_rows(sample_rows)
    return {
        "mode": "manual_prompt_ferry",
        "target_use": "governance_candidates",
        "prompt": prompt,
        "full_prompt_text": f"{prompt}\n\nSample rows:\n{compact}" if compact else prompt,
        "expected_output_schema": ["table_name", "column_name", "candidate_label", "reason", "evidence", "needs_human_review"],
        "notes": "Paste prompt into Copilot or another LLM, then review before storing approved governance labels.",
        "sample_rows": compact,
    }