File size: 702 Bytes
c321956 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
from langchain.vectorstores import Chroma
from langchain.chat_models import ChatOpenAI
from langchain.chains import ConversationalRetrievalChain
class StateManager:
def __init__(self):
self.vectorstore = None
self.conversation_chain = None
def create_vectorstore(self, text_chunks):
self.vectorstore = self.get_vectorstore(text_chunks)
def create_conversation_chain(self):
self.conversation_chain = self.get_conversation_chain()
def get_vectorstore(self, text_chunks):
# Your existing get_vectorstore function logic
pass
def get_conversation_chain(self):
# Your existing get_conversation_chain function logic
pass |