alexkueck commited on
Commit
2e4f369
1 Parent(s): 204683a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +9 -8
app.py CHANGED
@@ -14,9 +14,9 @@ from langchain.embeddings.openai import OpenAIEmbeddings
14
  from langchain.prompts import PromptTemplate
15
  from langchain.text_splitter import RecursiveCharacterTextSplitter
16
  from langchain.vectorstores import Chroma
17
- from langchain.vectorstores import MongoDBAtlasVectorSearch
18
 
19
- from pymongo import MongoClient
20
 
21
  from dotenv import load_dotenv, find_dotenv
22
  _ = load_dotenv(find_dotenv())
@@ -33,12 +33,13 @@ client = OpenAI(
33
 
34
  #openai.api_key = os.getenv["OPENAI_API_KEY"]
35
 
36
- MONGODB_URI = os.environ["MONGODB_ATLAS_CLUSTER_URI"]
37
- client = MongoClient(MONGODB_URI)
38
- MONGODB_DB_NAME = "langchain_db"
39
- MONGODB_COLLECTION_NAME = "gpt-4"
40
- MONGODB_COLLECTION = client[MONGODB_DB_NAME][MONGODB_COLLECTION_NAME]
41
- MONGODB_INDEX_NAME = "default"
 
42
 
43
  template = """If you don't know the answer, just say that you don't know, don't try to make up an answer. Keep the answer as concise as possible. Always say
44
  "🧠 Thanks for using the app - Bernd" at the end of the answer. """
 
14
  from langchain.prompts import PromptTemplate
15
  from langchain.text_splitter import RecursiveCharacterTextSplitter
16
  from langchain.vectorstores import Chroma
17
+ #from langchain.vectorstores import MongoDBAtlasVectorSearch
18
 
19
+ #from pymongo import MongoClient
20
 
21
  from dotenv import load_dotenv, find_dotenv
22
  _ = load_dotenv(find_dotenv())
 
33
 
34
  #openai.api_key = os.getenv["OPENAI_API_KEY"]
35
 
36
+ #Für MongoDB statt Chroma als Vektorstore
37
+ #MONGODB_URI = os.environ["MONGODB_ATLAS_CLUSTER_URI"]
38
+ #client = MongoClient(MONGODB_URI)
39
+ #MONGODB_DB_NAME = "langchain_db"
40
+ #MONGODB_COLLECTION_NAME = "gpt-4"
41
+ #MONGODB_COLLECTION = client[MONGODB_DB_NAME][MONGODB_COLLECTION_NAME]
42
+ #MONGODB_INDEX_NAME = "default"
43
 
44
  template = """If you don't know the answer, just say that you don't know, don't try to make up an answer. Keep the answer as concise as possible. Always say
45
  "🧠 Thanks for using the app - Bernd" at the end of the answer. """