mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-25 06:44:59 +00:00
record response hashes too
This commit is contained in:
parent
974d96973c
commit
9cfebc0b60
2 changed files with 12 additions and 2 deletions
|
@ -104,6 +104,7 @@ class Coder:
|
||||||
fnames = []
|
fnames = []
|
||||||
|
|
||||||
self.chat_completion_call_hashes = []
|
self.chat_completion_call_hashes = []
|
||||||
|
self.chat_completion_response_hashes = []
|
||||||
|
|
||||||
self.verbose = verbose
|
self.verbose = verbose
|
||||||
self.abs_fnames = set()
|
self.abs_fnames = set()
|
||||||
|
@ -611,6 +612,13 @@ class Coder:
|
||||||
except AttributeError as content_err:
|
except AttributeError as content_err:
|
||||||
show_content_err = content_err
|
show_content_err = content_err
|
||||||
|
|
||||||
|
resp_hash = dict(
|
||||||
|
function_call=self.partial_response_function_call,
|
||||||
|
content=self.partial_response_content,
|
||||||
|
)
|
||||||
|
resp_hash = hashlib.sha1(json.dumps(resp_hash, sort_keys=True).encode())
|
||||||
|
self.chat_completion_response_hashes.append(resp_hash.hexdigest())
|
||||||
|
|
||||||
if show_func_err and show_content_err:
|
if show_func_err and show_content_err:
|
||||||
self.io.tool_error(show_func_err)
|
self.io.tool_error(show_func_err)
|
||||||
self.io.tool_error(show_content_err)
|
self.io.tool_error(show_content_err)
|
||||||
|
|
|
@ -65,7 +65,7 @@ def main(
|
||||||
priors = list(BENCHMARK_DNAME.glob(f"*--{dirname}"))
|
priors = list(BENCHMARK_DNAME.glob(f"*--{dirname}"))
|
||||||
if len(priors) == 1 and stats_only:
|
if len(priors) == 1 and stats_only:
|
||||||
dirname = priors[0].name
|
dirname = priors[0].name
|
||||||
print(f'Using pre-existing {dirname}')
|
print(f"Using pre-existing {dirname}")
|
||||||
elif len(priors):
|
elif len(priors):
|
||||||
if not make_new:
|
if not make_new:
|
||||||
print(f"Prior runs of {dirname} exist, use --new or name one explicitly")
|
print(f"Prior runs of {dirname} exist, use --new or name one explicitly")
|
||||||
|
@ -348,6 +348,8 @@ Fix the code in {file_list} to resolve the errors.
|
||||||
commit_hash=commit_hash,
|
commit_hash=commit_hash,
|
||||||
num_error_outputs=io.num_error_outputs,
|
num_error_outputs=io.num_error_outputs,
|
||||||
num_user_asks=io.num_user_asks,
|
num_user_asks=io.num_user_asks,
|
||||||
|
chat_completion_call_hashes=coder.chat_completion_call_hashes,
|
||||||
|
chat_completion_response_hashes=coder.chat_completion_response_hashes,
|
||||||
)
|
)
|
||||||
dump(results)
|
dump(results)
|
||||||
|
|
||||||
|
@ -376,7 +378,7 @@ def run_unit_tests(testdir, history_fname):
|
||||||
DOCKER_IMAGE,
|
DOCKER_IMAGE,
|
||||||
"bash",
|
"bash",
|
||||||
"-c",
|
"-c",
|
||||||
f"pip install pytest && pytest /app/{test_file.name}",
|
f"pytest /app/{test_file.name}",
|
||||||
]
|
]
|
||||||
print(" ".join(command))
|
print(" ".join(command))
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue