19 lines
813 B
Python
19 lines
813 B
Python
#!/usr/bin/env python3
|
|
fp = '/home/uroma/promptarch/components/AIAssist.tsx'
|
|
with open(fp, 'r') as f:
|
|
lines = f.readlines()
|
|
|
|
bt = chr(96) # backtick character
|
|
nl = chr(92) + 'n' # \n
|
|
|
|
for i, line in enumerate(lines):
|
|
if 'const reviewPrompt' in line and 'review this generated code' in line:
|
|
new_line = ' const reviewPrompt = "Please review this generated code for bugs, security issues, performance problems, and best practices. Provide specific improvements:" + "' + nl + '" + "' + nl + '" + "' + bt*3 + '" + (previewData.language || "code") + "' + nl + '" + previewData.data + "' + nl + '" + "' + bt*3 + '";\n'
|
|
lines[i] = new_line
|
|
print(f'Fixed line {i+1}')
|
|
print(repr(new_line))
|
|
break
|
|
|
|
with open(fp, 'w') as f:
|
|
f.writelines(lines)
|