from .base_task import BaseTask
class IsoCountIncreaseTask(BaseTask):
    def get_task_content(self, item):
        """
        Fetches 'text' and 'query', formats them, and returns the 
        standard content dictionary.
        """
        text = item['text_increase']
        query = item['query']
        prompt_key = self.config['prompt_template']

        # 1. Get templates
        text_template = self.prompt_templates[prompt_key]['text_prompt']
        inst_template = self.prompt_templates[prompt_key]['instruction_prompt']
        
        # 2. Format chunks
        text_chunk = text_template.replace("[[text_fill]]", f"{text}") + "."
        inst_chunk = inst_template.replace("[[query_item_fill]]", f"{query}")

        # 3. Create full prompt
        full_prompt_text = text_chunk + inst_chunk
        
        # 4. Return the standardized dictionary
        if self.config['image_type'] == 'blank':
            return {
                "full_prompt": full_prompt_text,
                "has_image": False,
                "has_blank_image": True,
                "chunks_for_attention": {
                    'text': text_chunk,
                    'instruction': inst_chunk
                }
            }
        else:
            return {
                "full_prompt": full_prompt_text,
                "has_image": True,
                "has_blank_image": False,
                "chunks_for_attention": {
                    'text': text_chunk,
                    'instruction': inst_chunk
                }
            }