Update rag.py
Browse files
rag.py
CHANGED
@@ -62,12 +62,12 @@ def document_splitting(config, docs):
|
|
62 |
|
63 |
def document_storage_chroma(chunks):
|
64 |
Chroma.from_documents(documents = chunks,
|
65 |
-
embedding = OpenAIEmbeddings(
|
66 |
persist_directory = CHROMA_DIR)
|
67 |
|
68 |
def document_storage_mongodb(chunks):
|
69 |
MongoDBAtlasVectorSearch.from_documents(documents = chunks,
|
70 |
-
embedding = OpenAIEmbeddings(
|
71 |
collection = collection,
|
72 |
index_name = MONGODB_INDEX_NAME)
|
73 |
|
@@ -86,7 +86,7 @@ def document_retrieval_chroma():
|
|
86 |
def document_retrieval_mongodb():
|
87 |
return MongoDBAtlasVectorSearch.from_connection_string(MONGODB_ATLAS_CLUSTER_URI,
|
88 |
MONGODB_DB_NAME + "." + MONGODB_COLLECTION_NAME,
|
89 |
-
OpenAIEmbeddings(
|
90 |
index_name = MONGODB_INDEX_NAME)
|
91 |
|
92 |
def get_llm(config, openai_api_key):
|
|
|
62 |
|
63 |
def document_storage_chroma(chunks):
|
64 |
Chroma.from_documents(documents = chunks,
|
65 |
+
embedding = OpenAIEmbeddings(),
|
66 |
persist_directory = CHROMA_DIR)
|
67 |
|
68 |
def document_storage_mongodb(chunks):
|
69 |
MongoDBAtlasVectorSearch.from_documents(documents = chunks,
|
70 |
+
embedding = OpenAIEmbeddings(),
|
71 |
collection = collection,
|
72 |
index_name = MONGODB_INDEX_NAME)
|
73 |
|
|
|
86 |
def document_retrieval_mongodb():
|
87 |
return MongoDBAtlasVectorSearch.from_connection_string(MONGODB_ATLAS_CLUSTER_URI,
|
88 |
MONGODB_DB_NAME + "." + MONGODB_COLLECTION_NAME,
|
89 |
+
OpenAIEmbeddings(),
|
90 |
index_name = MONGODB_INDEX_NAME)
|
91 |
|
92 |
def get_llm(config, openai_api_key):
|