| | |
| | | |
| | | def rewrite(self, input_path: str, output_path: str): |
| | | blocks = self.extract_docx_blocks_by_order(input_path) |
| | | self.logger.info(f"start to rewriting docx using gemini,using temperature:{self.temperature}. with style {self.rewrite_style}. {input_path}") |
| | | self.logger.info(f"start to rewriting docx using gemini,. with style {self.rewrite_style}. {input_path}") |
| | | if len(blocks) >0: |
| | | self.chat = self.model.start_chat(history=[]) |
| | | self.safe_send_message(GOOGLE_REWRITE_STYLE_MAP.get(self.rewrite_style, GEMINI_PROMPT_INIT_DEFAULT)) |