(self, question: str, query_type: str)
| 84 | def get_system_message(self) -> str: |
| 85 | return SYSTEM_MESSAGES.get(self._template_prefix, "") |
| 86 | |
| 87 | def format_memorize(self, context: str, timestamp: Optional[str] = None) -> str: |
| 88 | key = f"{self._template_prefix}_{self.method_type}_memorize" |
| 89 | template = MEMORIZE_TEMPLATES.get(key) |
| 90 | |
| 91 | if not template: |
| 92 | # Fallback to base dataset key (without language suffix) |
| 93 | key = f"{self.dataset}_{self.method_type}_memorize" |
| 94 | template = MEMORIZE_TEMPLATES.get(key) |
| 95 | |
| 96 | if not template: |
| 97 | return context |
| 98 | |
| 99 | params = {"context": context} |
| 100 | if timestamp and "{timestamp}" in template: |
| 101 | params["timestamp"] = timestamp |
| 102 | |
| 103 | return template.format(**params) |
| 104 | |
| 105 | def format_query(self, question: str, query_type: str, question_date: str = "", **kwargs) -> str: |
| 106 | key = f"{self._template_prefix}_{query_type}_qa" |
| 107 | template = QA_TEMPLATES.get(key) |
| 108 | |
| 109 | if not template: |
| 110 | # Fallback to base dataset key |
| 111 | key = f"{self.dataset}_{query_type}_qa" |
| 112 | template = QA_TEMPLATES.get(key) |
no test coverage detected