def my_llm_parse(system_prompt: str, user_content: str) -> list[dict]: ... # user's LLM client, returns the kept-entries JSON list toc_df = reconstruct_toc_from_body( line_df, span_df=span_df, mode="no_toc", max_passes=3, llm_parse=my_llm_parse, )