Stronger prompt

This commit is contained in:
Paul Gauthier 2023-06-24 15:49:26 -07:00
parent ac560c2877
commit a1f4ae6a07
3 changed files with 14 additions and 7 deletions

View file

@ -44,7 +44,7 @@ class WholeFileCoder(Coder):
full_path = (Path(self.root) / fname).absolute() full_path = (Path(self.root) / fname).absolute()
if mode == "diff" and full_path.exists(): if mode == "diff" and full_path.exists():
orig_lines = full_path.readlines() orig_lines = full_path.read_text().splitlines()
show_diff = diffs.diff_partial_update( show_diff = diffs.diff_partial_update(
orig_lines, orig_lines,
@ -93,7 +93,7 @@ class WholeFileCoder(Coder):
full_path = (Path(self.root) / fname).absolute() full_path = (Path(self.root) / fname).absolute()
if mode == "diff" and full_path.exists(): if mode == "diff" and full_path.exists():
orig_lines = full_path.readlines() orig_lines = full_path.read_text.splitlines()
show_diff = diffs.diff_partial_update( show_diff = diffs.diff_partial_update(
orig_lines, orig_lines,

View file

@ -17,17 +17,19 @@ Once you understand the request you MUST:
system_reminder = """ system_reminder = """
To return code you MUST use this *file listing* format: To return code you MUST use this *file listing* format:
exact/path/to/filename.js path/to/filename.js
```javascript ```javascript
// file content goes in the // entire file content goes in the
// triple backticked fenced block // triple backticked fenced block
``` ```
Every *file listing* must start with the full path! Every *file listing* MUST use this format:
Every *file listing* must be fenced w/triple backticks with the correct code language. - First line: the filename with any required path!
- Second line: opening triple backtick fence with the correct code language.
- Final line: closing triple backtick fence.
To suggest changes to a file you MUST return a *file listing* that contains the entire content of the file. To suggest changes to a file you MUST return a *file listing* that contains the entire content of the file.
Create a new file you MUST return a *file listing* which includes an appropriate path/filename. Create a new file you MUST return a *file listing* which includes an appropriate filename, including any required path.
""" """
files_content_prefix = "Here is the current content of the files:\n" files_content_prefix = "Here is the current content of the files:\n"

View file

@ -116,6 +116,11 @@ def main():
projected_cost = avg_cost * total_tests projected_cost = avg_cost * total_tests
dump(projected_cost) dump(projected_cost)
print(
f"Cost: ${avg_cost:.4f} average, ${total_cost:.2f} total,"
f" ${projected_cost:.2f} projected"
)
duration += results["duration"] duration += results["duration"]
avg_duration = duration / completed_tests avg_duration = duration / completed_tests
dump(avg_duration) dump(avg_duration)