Skip to content

Commit 01ee285

Browse files
authored
README.md: add missing imports to readme (#181)
1 parent 1eb9ddb commit 01ee285

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

README.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,18 +35,22 @@ pip install -U langchain-postgres
3535
For 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
3939
from 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"
4344
engine = PGEngine.from_connection_string(url=CONNECTION_STRING)
4445

46+
# Replace the vector size with your own vector size
4547
VECTOR_SIZE = 768
4648
embedding = DeterministicFakeEmbedding(size=VECTOR_SIZE)
4749

50+
TABLE_NAME = "my_doc_collection"
51+
4852
engine.init_vectorstore_table(
49-
table_name="destination_table",
53+
table_name=TABLE_NAME,
5054
vector_size=VECTOR_SIZE,
5155
)
5256

0 commit comments

Comments
 (0)