ArturG9's picture
Create state_manager.py
c321956 verified
raw
history blame
702 Bytes
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