ishans24 commited on
Commit
529c343
·
verified ·
1 Parent(s): 32b96c3

Update util.py

Browse files
Files changed (1) hide show
  1. util.py +2 -2
util.py CHANGED
@@ -8,6 +8,8 @@ from langchain_google_genai import GoogleGenerativeAIEmbeddings
8
  from langchain_google_genai import ChatGoogleGenerativeAI
9
  import google.generativeai as genai
10
  from dotenv import load_dotenv
 
 
11
 
12
  def extract_text(json_path):
13
  with open(json_path, 'r') as file:
@@ -41,8 +43,6 @@ def create_vector_store(chunks):
41
  vector_store.save_local("reviews_index")
42
 
43
  def main(json_path):
44
- load_dotenv()
45
- genai.configure(api_key=os.getenv("GOOGLE_API_KEY"))
46
  text = extract_text(json_path)
47
  chunks = split_text_into_chunks(text)
48
  create_vector_store(chunks)
 
8
  from langchain_google_genai import ChatGoogleGenerativeAI
9
  import google.generativeai as genai
10
  from dotenv import load_dotenv
11
+ load_dotenv()
12
+ genai.configure(api_key="AIzaSyCCIYW0HamEfEMyGMXhQypyYtiY4O2ixUg")
13
 
14
  def extract_text(json_path):
15
  with open(json_path, 'r') as file:
 
43
  vector_store.save_local("reviews_index")
44
 
45
  def main(json_path):
 
 
46
  text = extract_text(json_path)
47
  chunks = split_text_into_chunks(text)
48
  create_vector_store(chunks)