def gen_book_mindmap_corpus()

in src/models/struxgpt_v2.py [0:0]


    def gen_book_mindmap_corpus(self, book_struct: Optional[StructItem | dict], 
                                chapter_aspect: Optional[AspectItem | dict], idx: str):
        book_struct = self.check_struct_item(book_struct, StructItem)
        chapter_aspect = self.check_struct_item(chapter_aspect, AspectItem)

        prompt_template: str = random.choice(STRUCT_CORPUS_TMPL_POOL)
        book_mindmap = self.dump_mindmap(book_struct, highlights=[chapter_aspect.name])
        prompt = (
            f"In Medicine, {book_struct.scope} holds significant stature, "
            f"which comprises the following specialized subdomains:\n"
            f"{book_mindmap}\n\n"
        )

        prompt += prompt_template.split('\n\n')[0].format(field=chapter_aspect.name)

        chapter_mindmap = self.dump_mindmap(chapter_aspect.upgrad_to_struct())
        
        return {'idx': idx, 'prompt': prompt, 'response': chapter_mindmap}