docs: Update Vector Store docs formatting (#30359)

Description: Fix formatting in Vector Stores docs.

- astradb: fix API ref spacing
- milvus, pgvector, pinecone, qdrant: removed % in cmds for docs
consistency
- pgvector: removed redundant code and reorganized imports

---------

Co-authored-by: Chester Curme <chester.curme@gmail.com>
This commit is contained in:
Brandon Luu 2025-03-19 08:54:18 -07:00 committed by GitHub
parent 5f812f5968
commit 5ede4248ef
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 7 additions and 9 deletions

View File

@ -505,7 +505,7 @@
"source": [ "source": [
"## API reference\n", "## API reference\n",
"\n", "\n",
"For detailed documentation of all `AstraDBVectorStore` features and configurations head to the API reference:https://python.langchain.com/api_reference/astradb/vectorstores/langchain_astradb.vectorstores.AstraDBVectorStore.html" "For detailed documentation of all `AstraDBVectorStore` features and configurations head to the API reference: https://python.langchain.com/api_reference/astradb/vectorstores/langchain_astradb.vectorstores.AstraDBVectorStore.html"
] ]
} }
], ],

View File

@ -36,7 +36,7 @@
} }
], ],
"source": [ "source": [
"%pip install -qU langchain_milvus" "pip install -qU langchain_milvus"
] ]
}, },
{ {

View File

@ -113,22 +113,19 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 2, "execution_count": null,
"id": "979a65bd-742f-4b0d-be1e-c0baae245ec6", "id": "979a65bd-742f-4b0d-be1e-c0baae245ec6",
"metadata": { "metadata": {
"tags": [] "tags": []
}, },
"outputs": [], "outputs": [],
"source": [ "source": [
"from langchain_core.documents import Document\n",
"from langchain_postgres import PGVector\n", "from langchain_postgres import PGVector\n",
"from langchain_postgres.vectorstores import PGVector\n",
"\n", "\n",
"# See docker command above to launch a postgres instance with pgvector enabled.\n", "# See docker command above to launch a postgres instance with pgvector enabled.\n",
"connection = \"postgresql+psycopg://langchain:langchain@localhost:6024/langchain\" # Uses psycopg3!\n", "connection = \"postgresql+psycopg://langchain:langchain@localhost:6024/langchain\" # Uses psycopg3!\n",
"collection_name = \"my_docs\"\n", "collection_name = \"my_docs\"\n",
"\n", "\n",
"\n",
"vector_store = PGVector(\n", "vector_store = PGVector(\n",
" embeddings=embeddings,\n", " embeddings=embeddings,\n",
" collection_name=collection_name,\n", " collection_name=collection_name,\n",
@ -169,6 +166,8 @@
} }
], ],
"source": [ "source": [
"from langchain_core.documents import Document\n",
"\n",
"docs = [\n", "docs = [\n",
" Document(\n", " Document(\n",
" page_content=\"there are cats in the pond\",\n", " page_content=\"there are cats in the pond\",\n",

View File

@ -26,7 +26,7 @@
}, },
"outputs": [], "outputs": [],
"source": [ "source": [
"%pip install -qU langchain-pinecone pinecone-notebooks" "pip install -qU langchain-pinecone pinecone-notebooks"
] ]
}, },
{ {
@ -56,7 +56,6 @@
"source": [ "source": [
"import getpass\n", "import getpass\n",
"import os\n", "import os\n",
"import time\n",
"\n", "\n",
"from pinecone import Pinecone, ServerlessSpec\n", "from pinecone import Pinecone, ServerlessSpec\n",
"\n", "\n",

View File

@ -32,7 +32,7 @@
}, },
"outputs": [], "outputs": [],
"source": [ "source": [
"%pip install -qU langchain-qdrant" "pip install -qU langchain-qdrant"
] ]
}, },
{ {