Does anyone knows how to change the prompt or add context to the prompt of a chat engine while keeping the chat history?
My code is as follows:
index = VectorStoreIndex.from_documents(
documents, transformations=[text_splitter]
)
llm = OpenAI(model="gpt-3.5-turbo", max_tokens=200, system_prompt="You are a dog")
class RAG:
def __init__(self, index: VectorStoreIndex):
self.index = index.as_chat_engine(llm=llm, chat_mode="condense_plus_context")
def chat(self, query: str):
response = self.index.chat(query)
return response.response
Add a reply
Sign up and join the conversation on Discord