Merge pull request #1556 from benedict-lee/main

Fix prompt to not output diff prefixes in existing_code,improved_code pydantic definitions
This commit is contained in:
Tal 2025-02-24 22:10:30 +02:00 committed by GitHub
commit 393516f746
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -782,6 +782,7 @@ def try_fix_yaml(response_text: str,
# fifth fallback - try to remove leading '+' (sometimes added by AI for 'existing code' and 'improved code')
response_text_lines_copy = response_text_lines.copy()
for i in range(0, len(response_text_lines_copy)):
if response_text_lines_copy[i].startswith('+'):
response_text_lines_copy[i] = ' ' + response_text_lines_copy[i][1:]
try:
data = yaml.safe_load('\n'.join(response_text_lines_copy))