Merge pull request #1073 from h0rv/patch-1

Improve response cleaning
This commit is contained in:
Tal
2024-08-02 12:21:40 +03:00
committed by GitHub

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('\n').removeprefix('```yaml').rstrip('`')
response_text = response_text.strip('\n').removeprefix('```yaml').rstrip().removesuffix('```')
try:
data = yaml.safe_load(response_text)
except Exception as e: