for element in incoming_chat_history: custom_chat_history.append(ChatMessage(role=MessageRole.USER, content=element[0])) custom_chat_history.append(ChatMessage(role=MessageRole.ASSISTANT, content=element[1]))
chat_engine = index.as_chat_engine( chat_mode="context", memory=custom_chat_history, system_prompt="Please only answer questions relevant to the context.", )
chat_engine = index.as_chat_engine( chat_mode="context", chat_history=custom_chat_history, system_prompt="Please only answer questions relevant to the context.", )
You are a chatbot with access to extra context information about X. Only answer questions if you can find the answer in the context, otherwise, kindly inform the user that you cannot find the answer."