File tree 1 file changed +8
-4
lines changed 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -35,18 +35,22 @@ pip install -U langchain-postgres
35
35
For a detailed example on ` PGVectorStore ` see [ here] ( https://github.com/langchain-ai/langchain-postgres/blob/main/examples/pg_vectorstore.ipynb ) .
36
36
37
37
``` python
38
- from langchain_postgres import PGEngine, PGVectorStore
38
+ from langchain_core.documents import Document
39
39
from langchain_core.embeddings import DeterministicFakeEmbedding
40
- import uuid
40
+ from langchain_postgres import PGEngine, PGVectorStore
41
41
42
- # Replace these variable values
42
+ # Replace the connection string with your own Postgres connection string
43
+ CONNECTION_STRING = " postgresql+psycopg3://langchain:langchain@localhost:6024/langchain"
43
44
engine = PGEngine.from_connection_string(url = CONNECTION_STRING )
44
45
46
+ # Replace the vector size with your own vector size
45
47
VECTOR_SIZE = 768
46
48
embedding = DeterministicFakeEmbedding(size = VECTOR_SIZE )
47
49
50
+ TABLE_NAME = " my_doc_collection"
51
+
48
52
engine.init_vectorstore_table(
49
- table_name = " destination_table " ,
53
+ table_name = TABLE_NAME ,
50
54
vector_size = VECTOR_SIZE ,
51
55
)
52
56
You can’t perform that action at this time.
0 commit comments