query_engine = index.as_query_engine(text_qa_template=Prompt(CHAT_PROMPT), verbose=True) chat_engine = index.as_chat_engine( query_engine=query_engine, chat_mode="context", chat_history=chat_history, query_str=query, similarity_top_k=2, verbose=True, )
index.as_chat_engine(chat_mode="context", system_prompt="Talk like a pirate.")