Provide a reflection on produced behavior for next execution @return: (str) language model-produced reflection
(self)
| 317 | return model_resp, cmd_str |
| 318 | |
| 319 | def reflect_code(self): |
| 320 | """ |
| 321 | Provide a reflection on produced behavior for next execution |
| 322 | @return: (str) language model-produced reflection |
| 323 | """ |
| 324 | code_strs = ("$"*40 + "\n\n").join([self.generate_code_lines(_code[0]) + f"\nCode Return {_code[1]}" for _code in self.best_codes]) |
| 325 | code_strs = f"Please reflect on the following sets of code: {code_strs} and come up with generalizable insights that will help you improve your performance on this benchmark." |
| 326 | syst = self.system_prompt(commands=False) + code_strs |
| 327 | return query_model(prompt="Please reflect on ideas for how to improve your current code. Examine the provided code and think very specifically (with precise ideas) on how to improve performance, which methods to use, how to improve generalization on the test set with line-by-line examples below:\n", system_prompt=syst, model_str=f"{self.llm_str}", openai_api_key=self.openai_api_key) |
| 328 | |
| 329 | def process_command(self, model_resp): |
| 330 | """ |
no test coverage detected