mirror of
https://github.com/hwchase17/langchain.git
synced 2025-06-21 14:18:52 +00:00
docs: Update VectorStoreTab vector store initializations (#30413)
Description: Update vector store tab inits to match either the docs or api_ref (whichever was more comprehensive) List of changes per vector stores: - In-memory - no change - AstraDB - match to docs - docs/api_refs match (excluding embeddings) - Chroma - match to docs - api_refs is less descriptive - FAISS - match to docs - docs/api_refs match (excluding embeddings) - Milvus - match to docs to use Milvus Lite with Flat index - api_refs does not have index_param for generalization - MongoDB - match to docs - api_refs are sparser - PGVector - match to api_ref - changed to include docker cmd directly in code - docs/api_ref has comment to view docker command in separate code block - Pinecone - match to api_refs - docs have code dispersed - Qdrant - match to api_ref - docs has size=3072, api_ref has size=1536 --------- Co-authored-by: Chester Curme <chester.curme@gmail.com>
This commit is contained in:
parent
e7032901c3
commit
bbbd4e1db8
@ -28,21 +28,21 @@ export default function VectorStoreTabs(props) {
|
|||||||
{
|
{
|
||||||
value: "Chroma",
|
value: "Chroma",
|
||||||
label: "Chroma",
|
label: "Chroma",
|
||||||
text: `from langchain_chroma import Chroma\n${useFakeEmbeddings ? fakeEmbeddingsString : ""}\n${vectorStoreVarName} = Chroma(embedding_function=embeddings)`,
|
text: `from langchain_chroma import Chroma\n${useFakeEmbeddings ? fakeEmbeddingsString : ""}\n${vectorStoreVarName} = Chroma(\n collection_name="example_collection",\n embedding_function=embeddings,\n persist_directory="./chroma_langchain_db", # Where to save data locally, remove if not necessary\n)`,
|
||||||
packageName: "langchain-chroma",
|
packageName: "langchain-chroma",
|
||||||
default: false,
|
default: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: "FAISS",
|
value: "FAISS",
|
||||||
label: "FAISS",
|
label: "FAISS",
|
||||||
text: `from langchain_community.vectorstores import FAISS\n${useFakeEmbeddings ? fakeEmbeddingsString : ""}\n${vectorStoreVarName} = FAISS(embedding_function=embeddings)`,
|
text: `import faiss\nfrom langchain_community.docstore.in_memory import InMemoryDocstore\nfrom langchain_community.vectorstores import FAISS\n\nembedding_dim = len(embeddings.embed_query("hello world"))\nindex = faiss.IndexFlatL2(embedding_dim)\n${useFakeEmbeddings ? fakeEmbeddingsString : ""}\n${vectorStoreVarName} = FAISS(\n embedding_function=embeddings,\n index=index,\n docstore=InMemoryDocstore(),\n index_to_docstore_id={},\n)`,
|
||||||
packageName: "langchain-community",
|
packageName: "langchain-community",
|
||||||
default: false,
|
default: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
value: "Milvus",
|
value: "Milvus",
|
||||||
label: "Milvus",
|
label: "Milvus",
|
||||||
text: `from langchain_milvus import Milvus\n${useFakeEmbeddings ? fakeEmbeddingsString : ""}\n${vectorStoreVarName} = Milvus(embedding_function=embeddings)`,
|
text: `from langchain_milvus import Milvus\n\nURI = "./milvus_example.db"\n${useFakeEmbeddings ? fakeEmbeddingsString : ""}\n${vectorStoreVarName} = Milvus(\n embedding_function=embeddings,\n connection_args={"uri": URI},\n index_params={"index_type": "FLAT", "metric_type": "L2"},\n)`,
|
||||||
packageName: "langchain-milvus",
|
packageName: "langchain-milvus",
|
||||||
default: false,
|
default: false,
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user