def _convert_to_yaml_literal_string(d: Any) -> Any:
    """Convert any multi-line strings in nested data object to LiteralScalarString.
    This will then use the `|-` syntax of yaml.
    """
    d = deepcopy(d)
    if isinstance(d, dict):
        for key, value in d.items():
            d[key] = _convert_to_yaml_literal_string(value)
    elif isinstance(d, list):
        for i, item in enumerate(d):
            d[i] = _convert_to_yaml_literal_string(item)
    elif isinstance(d, str) and "\n" in d:
        d = LSS(d.replace("\r\n", "\n").replace("\r", "\n"))
    return d
Convert any multi-line strings in nested data object to LiteralScalarString.
    This will then use the `|-` syntax of yaml.
    
sweagent/utils/serialization.py