text: the Instructions so that Assistant would quickly and correctly respond in the future.    ####    {chat_history}    ####    Please reflect on these interactions.    You should first critique Assistant's performance. What could Assistant have done better? What should the Assistant remember about this user? Are there things this user always wants? Indicate this with "Critique: ...".    You should next revise the Instructions so that Assistant would quickly and correctly respond in the future. Assistant's goal is to satisfy the user in as few interactions as possible. Assistant will only see the new Instructions, not the interaction history, so anything important must be summarized in the Instructions. Don't forget any important details in the current Instructions! Indicate the new Instructions by "Instructions: ...".    """    meta_prompt = PromptTemplate(        input_variables=["chat_history"], template=meta_template    )    meta_chain = LLMChain(        llm=OpenAI(temperature=0),        prompt=meta_prompt,        verbose=True,    )    return meta_chaindef get_chat_history(chain_memory):    memory_key = chain_memory.memory_key    chat_history = chain_memory.load_memory_variables(memory_key)[memory_key]    return chat_historydef get_new_instructions(meta_output):    delimiter = "Instructions: "    new_instructions = meta_output[meta_output.find(delimiter) + len(delimiter) :]    return new_instructionsdef main(task, max_iters=3, max_meta_iters=5):    failed_phrase = "task failed"    success_phrase = "task succeeded"    key_phrases = [success_phrase, failed_phrase]    instructions = "None"