def messages_format_preprocessor(inp: dict) -> ChatFormattedDict:
    """Convert from QA format to our chat format."""
    try:
        messages = inp['messages']
    except Exception as e:
        raise UnableToProcessPromptResponseError(inp) from e
    return {'messages': messages}
Convert from QA format to our chat format.
llmfoundry/data/finetuning/tasks.py