mirror of
https://github.com/qodo-ai/pr-agent.git
synced 2025-12-12 02:45:18 +00:00
fix: correct YAML formatting in response text processing in utils.py
This commit is contained in:
parent
b9d096187a
commit
441e098e2a
1 changed files with 2 additions and 2 deletions
|
|
@ -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")
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue