def get_report_summary( dataset: pd.DataFrame, dataset_name: str, dataset_source: str, report_format: Literal["markdown", "html"] = "markdown", ) -> str: """ Generate an AI-powered summary report from a pandas DataFrame. This function analyzes a dataset and generates a comprehensive summary report using a large language model (LLM). It first extracts statistical context from the dataset, then uses an LLM to create a human-readable report in the specified format. Parameters ---------- dataset : pd.DataFrame The pandas DataFrame to analyze and summarize. dataset_name : str A descriptive name for the dataset that will be included in the generated report for context and identification. dataset_source : str Information about the source or origin of the dataset. report_format : {"markdown", "html"}, optional The desired output format for the generated report. Options are: - "markdown" : Generate report in Markdown format (default) - "html" : Generate report in HTML format Returns ------- str A formatted summary report. """ context_message = get_summary_context_message(df=dataset) prompt = SUMMARIZE_DATAFRAME_PROMPT.format( dataset_name=dataset_name, dataset_source=dataset_source, context=context_message, report_format=report_format, ) return get_llm().invoke(input=prompt).content