bstraehle commited on
Commit
3940450
1 Parent(s): 1342013

Update rag_llamaindex.py

Browse files
Files changed (1) hide show
  1. rag_llamaindex.py +7 -7
rag_llamaindex.py CHANGED
@@ -40,7 +40,7 @@ class LlamaIndexRAG(BaseRAG):
40
  out_path = out_dir / "gpt-4.pdf"
41
 
42
  if not out_path.exists():
43
- r = requests.get(PDF_URL)
44
  with open(out_path, "wb") as f:
45
  f.write(r.content)
46
 
@@ -50,13 +50,13 @@ class LlamaIndexRAG(BaseRAG):
50
  # Web
51
  SimpleWebPageReader = download_loader("SimpleWebPageReader")
52
  loader = SimpleWebPageReader()
53
- docs.extend(loader.load_data(urls = [WEB_URL]))
54
  #print("docs = " + str(len(docs)))
55
 
56
  # YouTube
57
  loader = YoutubeTranscriptReader()
58
- docs.extend(loader.load_data(ytlinks = [YOUTUBE_URL_1,
59
- YOUTUBE_URL_2]))
60
  #print("docs = " + str(len(docs)))
61
 
62
  return docs
@@ -72,10 +72,10 @@ class LlamaIndexRAG(BaseRAG):
72
 
73
  def get_vector_store(self):
74
  return MongoDBAtlasVectorSearch(
75
- MongoClient(MONGODB_ATLAS_CLUSTER_URI),
76
  db_name = MONGODB_DB_NAME,
77
- collection_name = MONGODB_COLLECTION_NAME,
78
- index_name = MONGODB_INDEX_NAME
79
  )
80
 
81
  def ingestion(self, config):
 
40
  out_path = out_dir / "gpt-4.pdf"
41
 
42
  if not out_path.exists():
43
+ r = requests.get(self.PDF_URL)
44
  with open(out_path, "wb") as f:
45
  f.write(r.content)
46
 
 
50
  # Web
51
  SimpleWebPageReader = download_loader("SimpleWebPageReader")
52
  loader = SimpleWebPageReader()
53
+ docs.extend(loader.load_data(urls = [self.WEB_URL]))
54
  #print("docs = " + str(len(docs)))
55
 
56
  # YouTube
57
  loader = YoutubeTranscriptReader()
58
+ docs.extend(loader.load_data(ytlinks = [self.YOUTUBE_URL_1,
59
+ self.YOUTUBE_URL_2]))
60
  #print("docs = " + str(len(docs)))
61
 
62
  return docs
 
72
 
73
  def get_vector_store(self):
74
  return MongoDBAtlasVectorSearch(
75
+ MongoClient(self.MONGODB_ATLAS_CLUSTER_URI),
76
  db_name = MONGODB_DB_NAME,
77
+ collection_name = self.MONGODB_COLLECTION_NAME,
78
+ index_name = self.MONGODB_INDEX_NAME
79
  )
80
 
81
  def ingestion(self, config):