def gen_struct_corpus()

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


    def gen_struct_corpus(self, knowledge_struct: Optional[StructItem | dict], 
                                content_struct: Optional[StructItem | dict], 
                                content_text: str, idx: str):
        knowledge_struct = self.check_struct_item(knowledge_struct, StructItem)
        content_struct = self.check_struct_item(content_struct, StructItem)

        # prompt_template = (
        #     "In the realm of `{field}`, a conceptual mindmap is depicted using a tree-like structure "
        #     "to represent hierarchical relationships and thematic branches:\n\n"
        #     "```\n{mindmap}\n```\n\n"
        #     "Within this organized layout of `{field}`, the detailed subsection on `{aspect}` is described as:\n\n"
        # )
        prompt_template: str = random.choice(STRUCT_CORPUS_TMPL_POOL)
        field = knowledge_struct.scope
        aspect = content_struct.scope
        mindmap = self.dump_mindmap(knowledge_struct, highlights=[aspect,])
        prompt = prompt_template.format(field=field, mindmap=mindmap, aspect=aspect)

        return {'idx': idx, 'prompt': prompt, 'response': content_text}