-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
prompt_builder: add list of header files in code fixing prompt #318
base: main
Are you sure you want to change the base?
Conversation
/gcbrun exp -n dk1007 |
with open(HEADER_FIXER_PROMPT, 'r') as f: | ||
header_avoid_string = f.read() | ||
for header_file in headers_to_avoid: | ||
header_avoid_string += '- %s\n' % (os.path.basename(header_file)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
f-string, please :)
@@ -297,6 +299,17 @@ def _format_fixer_problem(self, raw_code: str, error_desc: Optional[str], | |||
else: | |||
# Build error does not pass error desc. | |||
error_summary = BUILD_ERROR_SUMMARY | |||
headers_to_avoid = introspector.query_introspector_header_files( | |||
benchmark.project) | |||
if len(headers_to_avoid) > 0: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: if headers_to_avoid:
for simplicity
@@ -83,6 +85,7 @@ def set_introspector_endpoints(endpoint): | |||
INTROSPECTOR_FUNC_SIG = f'{INTROSPECTOR_ENDPOINT}/function-signature' | |||
INTROSPECTOR_ADDR_TYPE = ( | |||
f'{INTROSPECTOR_ENDPOINT}/addr-to-recursive-dwarf-info') | |||
INTROSPECTOR_ALL_HEADER_FILES = (f'{INTROSPECTOR_ENDPOINT}/all-header-files') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need for ()
if this fits into one line.
@@ -46,6 +46,7 @@ | |||
'jansi_colors-problem.txt') | |||
FDP_JVM_EXAMPLE_2_SOLUTION = os.path.join(EXAMPLE_PATH, | |||
'jansi_colors-solution.java') | |||
HEADER_FIXER_PROMPT = os.path.join(DEFAULT_TEMPLATE_DIR, 'header_fixer.txt') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you add this file yet?
I'll put this on hold for a few days @DonggeLiu as I think it can be improved but it takes a bit of experimentation. |
No description provided.