Spaces:
Sleeping
Sleeping
angelesteban00
commited on
Commit
•
c09dc54
1
Parent(s):
cad5dc7
Update app.py
Browse files
app.py
CHANGED
@@ -14,13 +14,13 @@ from gradio.themes.base import Base
|
|
14 |
import os
|
15 |
|
16 |
DESCRIPTION = """\
|
17 |
-
|
18 |
This app is designed to provide a simple chat where to improve the answer from OpenAI with private information located in MongoDB Atlas cluster.<br>
|
19 |
|
20 |
# Prerequisites:
|
21 |
create a free DB called "langchain_demo" and a collection called "collection_of_text_blobs" in MongoDB Atlas (https://cloud.mongodb.com). After that, you have two options:
|
22 |
|
23 |
-
**option1**) execute locally "load_data.py" to create new documents and their embeddings in MongoDB
|
24 |
**option2**) import the JSON file "langchain_demo.collection_of_text_blobs.json"
|
25 |
|
26 |
# Dataset
|
@@ -46,6 +46,7 @@ The JSON documents in MongoDB looks like:
|
|
46 |
"source": "sample_files/chat_conversation.txt"
|
47 |
}
|
48 |
```
|
|
|
49 |
"""
|
50 |
|
51 |
def query_data(query,openai_api_key,mongo_uri):
|
|
|
14 |
import os
|
15 |
|
16 |
DESCRIPTION = """\
|
17 |
+
## RAG - MongoDB Atlas Vector Search & OpenAI
|
18 |
This app is designed to provide a simple chat where to improve the answer from OpenAI with private information located in MongoDB Atlas cluster.<br>
|
19 |
|
20 |
# Prerequisites:
|
21 |
create a free DB called "langchain_demo" and a collection called "collection_of_text_blobs" in MongoDB Atlas (https://cloud.mongodb.com). After that, you have two options:
|
22 |
|
23 |
+
**option1**) execute locally "load_data.py" to create new documents and their embeddings in MongoDB<br>
|
24 |
**option2**) import the JSON file "langchain_demo.collection_of_text_blobs.json"
|
25 |
|
26 |
# Dataset
|
|
|
46 |
"source": "sample_files/chat_conversation.txt"
|
47 |
}
|
48 |
```
|
49 |
+
# Demo
|
50 |
"""
|
51 |
|
52 |
def query_data(query,openai_api_key,mongo_uri):
|