Spaces:
Runtime error
Runtime error
Larry Yin
commited on
Commit
•
784d46d
1
Parent(s):
97cf1ed
Revised pgvector connection
Browse files
app.py
CHANGED
@@ -10,7 +10,7 @@ from langchain.memory import ConversationTokenBufferMemory
|
|
10 |
openai.api_key = os.environ['OPENAI_API_KEY']
|
11 |
hf_api_key = os.environ['HF_API_KEY']
|
12 |
host = os.environ['host']
|
13 |
-
port =
|
14 |
database_name = os.environ['database_name']
|
15 |
user = os.environ['user']
|
16 |
passwd = os.environ['passwd']
|
@@ -23,11 +23,11 @@ embedding = OpenAIEmbeddings()
|
|
23 |
|
24 |
CONNECTION_STRING = PGVector.connection_string_from_db_params(
|
25 |
driver=os.environ.get("PGVECTOR_DRIVER", "psycopg2"),
|
26 |
-
host=
|
27 |
-
port=int(
|
28 |
-
database=
|
29 |
-
user=
|
30 |
-
password=
|
31 |
)
|
32 |
|
33 |
vectordb = PGVector(embedding_function=embedding,
|
|
|
10 |
openai.api_key = os.environ['OPENAI_API_KEY']
|
11 |
hf_api_key = os.environ['HF_API_KEY']
|
12 |
host = os.environ['host']
|
13 |
+
port = os.environ['port']
|
14 |
database_name = os.environ['database_name']
|
15 |
user = os.environ['user']
|
16 |
passwd = os.environ['passwd']
|
|
|
23 |
|
24 |
CONNECTION_STRING = PGVector.connection_string_from_db_params(
|
25 |
driver=os.environ.get("PGVECTOR_DRIVER", "psycopg2"),
|
26 |
+
host=host
|
27 |
+
port=int(port),
|
28 |
+
database=database_name,
|
29 |
+
user=user,
|
30 |
+
password=passwd,
|
31 |
)
|
32 |
|
33 |
vectordb = PGVector(embedding_function=embedding,
|