Spaces:
Sleeping
Sleeping
angelesteban00
commited on
Commit
•
42c08ad
1
Parent(s):
8b0f111
- app.py +3 -3
- app_old.py +0 -7
- requirements.txt +1 -0
app.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
from pymongo import MongoClient
|
2 |
# error since Jan 2024, from langchain.embeddings.openai import OpenAIEmbeddings
|
3 |
-
from
|
4 |
# error since Jan 2024, from langchain.vectorstores import MongoDBAtlasVectorSearch
|
5 |
from langchain_community.vectorstores import MongoDBAtlasVectorSearch
|
6 |
# error since Jan 2024, from langchain.document_loaders import DirectoryLoader
|
@@ -14,8 +14,8 @@ from gradio.themes.base import Base
|
|
14 |
import os
|
15 |
|
16 |
def query_data(query,openai_api_key,mongo_uri):
|
17 |
-
|
18 |
-
|
19 |
|
20 |
client = MongoClient(mongo_uri)
|
21 |
dbName = "langchain_demo"
|
|
|
1 |
from pymongo import MongoClient
|
2 |
# error since Jan 2024, from langchain.embeddings.openai import OpenAIEmbeddings
|
3 |
+
from langchain_openai import OpenAIEmbeddings
|
4 |
# error since Jan 2024, from langchain.vectorstores import MongoDBAtlasVectorSearch
|
5 |
from langchain_community.vectorstores import MongoDBAtlasVectorSearch
|
6 |
# error since Jan 2024, from langchain.document_loaders import DirectoryLoader
|
|
|
14 |
import os
|
15 |
|
16 |
def query_data(query,openai_api_key,mongo_uri):
|
17 |
+
os.environ["OPENAI_API_KEY"] = openai_api_key
|
18 |
+
os.environ["MONGO_URI"] = mongo_uri
|
19 |
|
20 |
client = MongoClient(mongo_uri)
|
21 |
dbName = "langchain_demo"
|
app_old.py
DELETED
@@ -1,7 +0,0 @@
|
|
1 |
-
import gradio as gr
|
2 |
-
|
3 |
-
def greet(name):
|
4 |
-
return "Hola " + name + "!!"
|
5 |
-
|
6 |
-
iface = gr.Interface(fn=greet, inputs="text", outputs="text")
|
7 |
-
iface.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
requirements.txt
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
langchain
|
2 |
langchain-community
|
|
|
3 |
pymongo[srv]==4.1.1
|
4 |
bs4
|
5 |
openai
|
|
|
1 |
langchain
|
2 |
langchain-community
|
3 |
+
langchain-openai
|
4 |
pymongo[srv]==4.1.1
|
5 |
bs4
|
6 |
openai
|