File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
Expand file tree Collapse file tree 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
3535For a detailed example on ` PGVectorStore ` see [ here] ( https://github.com/langchain-ai/langchain-postgres/blob/main/examples/pg_vectorstore.ipynb ) .
3636
3737``` python
38- from langchain_postgres import PGEngine, PGVectorStore
38+ from langchain_core.documents import Document
3939from langchain_core.embeddings import DeterministicFakeEmbedding
40- import uuid
40+ from langchain_postgres import PGEngine, PGVectorStore
4141
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"
4344engine = PGEngine.from_connection_string(url = CONNECTION_STRING )
4445
46+ # Replace the vector size with your own vector size
4547VECTOR_SIZE = 768
4648embedding = DeterministicFakeEmbedding(size = VECTOR_SIZE )
4749
50+ TABLE_NAME = " my_doc_collection"
51+
4852engine.init_vectorstore_table(
49- table_name = " destination_table " ,
53+ table_name = TABLE_NAME ,
5054 vector_size = VECTOR_SIZE ,
5155)
5256
You can’t perform that action at this time.
0 commit comments