fix cleaning

This commit is contained in:
Robby
2024-08-01 15:50:00 -04:00
parent 172d0c0358
commit 039d85b836

View File

@ -557,7 +557,7 @@ def _fix_key_value(key: str, value: str):
def load_yaml(response_text: str, keys_fix_yaml: List[str] = [], first_key="", last_key="") -> dict:
response_text = response_text.strip().removeprefix("```yaml").removesuffix("```").strip()
response_text = response_text.strip('\n').removeprefix('```yaml').rstrip().removesuffix('```')
try:
data = yaml.safe_load(response_text)
except Exception as e: