def METHOD_NAME(state: QueryStateDict, result: Result) -> None:
    """Called when sentence processing is complete."""
    q: Query = state["query"]
    if "qtype" in result:
        # Successfully matched a query type
        try:
            if "wrong" in result:
                _gen_wrong_pic_answer(result, q)
            else:
                _gen_pic_answer(result, q)
        except Exception as e:
            logging.warning(f"Exception answering picture query: {e}")
            q.set_error(f"E_EXCEPTION: {e}")
            return
    else:
        q.set_error("E_QUERY_NOT_UNDERSTOOD")