(content, toc, model=None)
| 141 | |
| 142 | |
| 143 | def check_if_toc_transformation_is_complete(content, toc, model=None): |
| 144 | prompt = f""" |
| 145 | You are given a raw table of contents and a table of contents. |
| 146 | Your job is to check if the table of contents is complete. |
| 147 | |
| 148 | Reply format: |
| 149 | {{ |
| 150 | "thinking": <why do you think the cleaned table of contents is complete or not> |
| 151 | "completed": "yes" or "no" |
| 152 | }} |
| 153 | Directly return the final JSON structure. Do not output anything else.""" |
| 154 | |
| 155 | prompt = prompt + '\n Raw Table of contents:\n' + content + '\n Cleaned Table of contents:\n' + toc |
| 156 | response = llm_completion(model=model, prompt=prompt) |
| 157 | json_content = extract_json(response) |
| 158 | return json_content['completed'] |
| 159 | |
| 160 | def extract_toc_content(content, model=None): |
| 161 | prompt = f""" |
no test coverage detected