mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-07-05 13:20:39 +08:00
fix: correct YAML formatting in response text processing in utils.py
This commit is contained in:
@ -585,9 +585,9 @@ def try_fix_yaml(response_text: str,
|
|||||||
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)):
|
||||||
for key in keys_yaml:
|
for key in keys_yaml:
|
||||||
if key in response_text_lines_copy[i] and not '|-' in response_text_lines_copy[i]:
|
if key in response_text_lines_copy[i] and not '|' in response_text_lines_copy[i]:
|
||||||
response_text_lines_copy[i] = response_text_lines_copy[i].replace(f'{key}',
|
response_text_lines_copy[i] = response_text_lines_copy[i].replace(f'{key}',
|
||||||
f'{key} |-\n ')
|
f'{key} |\n ')
|
||||||
try:
|
try:
|
||||||
data = yaml.safe_load('\n'.join(response_text_lines_copy))
|
data = yaml.safe_load('\n'.join(response_text_lines_copy))
|
||||||
get_logger().info(f"Successfully parsed AI prediction after adding |-\n")
|
get_logger().info(f"Successfully parsed AI prediction after adding |-\n")
|
||||||
|
Reference in New Issue
Block a user