| 58 | Write code with triple quoto."""}] |
| 59 | |
| 60 | def get_write_msg(todo_file_name, done_file_lst): |
| 61 | code_files = "" |
| 62 | for done_file in done_file_lst: |
| 63 | if done_file.endswith(".yaml"): continue |
| 64 | code_files += f""" |
| 65 | ```python |
| 66 | {done_file_dict[done_file]} |
| 67 | ``` |
| 68 | |
| 69 | """ |
| 70 | |
| 71 | write_msg=[ |
| 72 | {'role': 'user', "content": f"""# Context |
| 73 | |
| 74 | ## Configuration file |
| 75 | ```yaml |
| 76 | {config_yaml} |
| 77 | ``` |
| 78 | ----- |
| 79 | |
| 80 | ## Code Files |
| 81 | {code_files} |
| 82 | |
| 83 | ----- |
| 84 | |
| 85 | # Format example |
| 86 | ## Code: {todo_file_name} |
| 87 | ```python |
| 88 | ## {todo_file_name} |
| 89 | ... |
| 90 | ``` |
| 91 | |
| 92 | ----- |
| 93 | |
| 94 | # Instruction |
| 95 | Based on the code files, follow "Format example", write the code. |
| 96 | |
| 97 | We have {done_file_lst}. |
| 98 | Next, you must write only the "{todo_file_name}". |
| 99 | |
| 100 | ## Code: {todo_file_name}"""}] |
| 101 | return write_msg |
| 102 | |
| 103 | |
| 104 | def api_call(msg): |