(self, prompt: str)
| 154 | return {"system_prompt": system_prompt, "user_prompt": user_prompt} |
| 155 | |
| 156 | def extract_example(self, prompt: str) -> list: |
| 157 | prompt = prompt['task'] |
| 158 | lines = (line.strip() for line in prompt.split('\n') if line.strip()) |
| 159 | |
| 160 | results = [] |
| 161 | lines_iter = iter(lines) |
| 162 | for line in lines_iter: |
| 163 | if line.startswith('>>>'): |
| 164 | function_call = line[4:] |
| 165 | expected_output = next(lines_iter, None) |
| 166 | if expected_output: |
| 167 | results.append(f"assert {function_call} == {expected_output}") |
| 168 | |
| 169 | return results |
| 170 | |
| 171 | def _execute(self, input:Dict[str,str], spatial_info:Dict[str,Any], temporal_info:Dict[str,Any],**kwargs): |
| 172 | """ To be overriden by the descendant class """ |
no test coverage detected