mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-07-06 13:50:44 +08:00
fix : refine handling of leading '+' in response text
This commit is contained in:
@ -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')
|
# fifth fallback - try to remove leading '+' (sometimes added by AI for 'existing code' and 'improved code')
|
||||||
response_text_lines_copy = response_text_lines.copy()
|
response_text_lines_copy = response_text_lines.copy()
|
||||||
for i in range(0, len(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:]
|
response_text_lines_copy[i] = ' ' + response_text_lines_copy[i][1:]
|
||||||
try:
|
try:
|
||||||
data = yaml.safe_load('\n'.join(response_text_lines_copy))
|
data = yaml.safe_load('\n'.join(response_text_lines_copy))
|
||||||
|
Reference in New Issue
Block a user