def reformat_npcs(npcs):
    """ 
    helper function to make the data tidy
    """
    new_npcs = []
    for npc in npcs:

        # include a name field in each for filtering
        name = npc['name']

        for key,value in npc.items():
            doc = {"name":name, "text":f"my {key} is {value}"}
            new_npcs.append(doc)
    return new_npcs
 
    helper function to make the data tidy
    
examples/GPT-examples/utilities.py