id
stringlengths
14
15
text
stringlengths
35
2.51k
source
stringlengths
61
154
6d61979c76cd-2
Run when chain starts running. on_chat_model_start(serialized: Dict[str, Any], messages: List[List[BaseMessage]], *, run_id: UUID, parent_run_id: Optional[UUID] = None, tags: Optional[List[str]] = None, **kwargs: Any) → Any¶ Run when a chat model starts running. on_llm_end(response: LLMResult, **kwargs: Any) → None[sou...
https://api.python.langchain.com/en/latest/callbacks/langchain.callbacks.openai_info.OpenAICallbackHandler.html
6d61979c76cd-3
Run on arbitrary text. on_tool_end(output: str, *, run_id: UUID, parent_run_id: Optional[UUID] = None, **kwargs: Any) → Any¶ Run when tool ends running. on_tool_error(error: Union[Exception, KeyboardInterrupt], *, run_id: UUID, parent_run_id: Optional[UUID] = None, **kwargs: Any) → Any¶ Run when tool errors. on_tool_st...
https://api.python.langchain.com/en/latest/callbacks/langchain.callbacks.openai_info.OpenAICallbackHandler.html
18f352ccaac5-0
langchain.callbacks.whylabs_callback.import_langkit¶ langchain.callbacks.whylabs_callback.import_langkit(sentiment: bool = False, toxicity: bool = False, themes: bool = False) → Any[source]¶ Import the langkit python package and raise an error if it is not installed. Parameters sentiment – Whether to import the langkit...
https://api.python.langchain.com/en/latest/callbacks/langchain.callbacks.whylabs_callback.import_langkit.html
a18e7b38ddc9-0
langchain.callbacks.utils.load_json¶ langchain.callbacks.utils.load_json(json_path: Union[str, Path]) → str[source]¶ Load json file to a string. Parameters json_path (str) – The path to the json file. Returns The string representation of the json file. Return type (str)
https://api.python.langchain.com/en/latest/callbacks/langchain.callbacks.utils.load_json.html
7be9e841fc09-0
langchain.callbacks.promptlayer_callback.PromptLayerCallbackHandler¶ class langchain.callbacks.promptlayer_callback.PromptLayerCallbackHandler(pl_id_callback: Optional[Callable[[...], Any]] = None, pl_tags: Optional[List[str]] = [])[source]¶ Bases: BaseCallbackHandler Callback handler for promptlayer. Initialize the Pr...
https://api.python.langchain.com/en/latest/callbacks/langchain.callbacks.promptlayer_callback.PromptLayerCallbackHandler.html
7be9e841fc09-1
Run when Retriever errors. on_retriever_start(query, *, run_id[, ...]) Run when Retriever starts running. on_text(text, *, run_id[, parent_run_id]) Run on arbitrary text. on_tool_end(output, *, run_id[, parent_run_id]) Run when tool ends running. on_tool_error(error, *, run_id[, parent_run_id]) Run when tool errors. on...
https://api.python.langchain.com/en/latest/callbacks/langchain.callbacks.promptlayer_callback.PromptLayerCallbackHandler.html
7be9e841fc09-2
Run when chain errors. on_chain_start(serialized: Dict[str, Any], inputs: Dict[str, Any], *, run_id: UUID, parent_run_id: Optional[UUID] = None, tags: Optional[List[str]] = None, **kwargs: Any) → Any¶ Run when chain starts running. on_chat_model_start(serialized: Dict[str, Any], messages: List[List[BaseMessage]], *, ru...
https://api.python.langchain.com/en/latest/callbacks/langchain.callbacks.promptlayer_callback.PromptLayerCallbackHandler.html
7be9e841fc09-3
Run when Retriever ends running. on_retriever_error(error: Union[Exception, KeyboardInterrupt], *, run_id: UUID, parent_run_id: Optional[UUID] = None, **kwargs: Any) → Any¶ Run when Retriever errors. on_retriever_start(query: str, *, run_id: UUID, parent_run_id: Optional[UUID] = None, **kwargs: Any) → Any¶ Run when Ret...
https://api.python.langchain.com/en/latest/callbacks/langchain.callbacks.promptlayer_callback.PromptLayerCallbackHandler.html
7fa00c580b93-0
langchain.docstore.arbitrary_fn.DocstoreFn¶ class langchain.docstore.arbitrary_fn.DocstoreFn(lookup_fn: Callable[[str], Union[Document, str]])[source]¶ Bases: Docstore Langchain Docstore via arbitrary lookup function. This is useful when: it’s expensive to construct an InMemoryDocstore/dict you retrieve documents from ...
https://api.python.langchain.com/en/latest/docstore/langchain.docstore.arbitrary_fn.DocstoreFn.html
06c27a7688b0-0
langchain.docstore.in_memory.InMemoryDocstore¶ class langchain.docstore.in_memory.InMemoryDocstore(_dict: Dict[str, Document])[source]¶ Bases: Docstore, AddableMixin Simple in memory docstore in the form of a dict. Initialize with dict. Methods __init__(_dict) Initialize with dict. add(texts) Add texts to in memory dic...
https://api.python.langchain.com/en/latest/docstore/langchain.docstore.in_memory.InMemoryDocstore.html
35410f99db1f-0
langchain.docstore.base.Docstore¶ class langchain.docstore.base.Docstore[source]¶ Bases: ABC Interface to access to place that stores documents. Methods __init__() search(search) Search for document. abstract search(search: str) → Union[str, Document][source]¶ Search for document. If page exists, return the page summar...
https://api.python.langchain.com/en/latest/docstore/langchain.docstore.base.Docstore.html
b04789bfcb86-0
langchain.docstore.wikipedia.Wikipedia¶ class langchain.docstore.wikipedia.Wikipedia[source]¶ Bases: Docstore Wrapper around wikipedia API. Check that wikipedia package is installed. Methods __init__() Check that wikipedia package is installed. search(search) Try to search for wiki page. search(search: str) → Union[str...
https://api.python.langchain.com/en/latest/docstore/langchain.docstore.wikipedia.Wikipedia.html
b4c0912a9df7-0
langchain.docstore.base.AddableMixin¶ class langchain.docstore.base.AddableMixin[source]¶ Bases: ABC Mixin class that supports adding texts. Methods __init__() add(texts) Add more documents. abstract add(texts: Dict[str, Document]) → None[source]¶ Add more documents.
https://api.python.langchain.com/en/latest/docstore/langchain.docstore.base.AddableMixin.html
9b49231f99a2-0
langchain.vectorstores.deeplake.DeepLake¶ class langchain.vectorstores.deeplake.DeepLake(dataset_path: str = './deeplake/', token: Optional[str] = None, embedding_function: Optional[Embeddings] = None, read_only: bool = False, ingestion_batch_size: int = 1000, num_workers: int = 0, verbose: bool = True, exec_option: st...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.deeplake.DeepLake.html
9b49231f99a2-1
... path = "hub://org_id/dataset_name", ... exec_option = "tensor_db", ... ) Parameters dataset_path (str) – Path to existing dataset or where to create a new one. Defaults to _LANGCHAIN_DEFAULT_DEEPLAKE_PATH. token (str, optional) – Activeloop token, for fetching credentials to the dataset at path if it ...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.deeplake.DeepLake.html
9b49231f99a2-2
Raises ValueError – If some condition is not met. Methods __init__([dataset_path, token, ...]) Creates an empty DeepLakeVectorStore or loads an existing one. aadd_documents(documents, **kwargs) Run more documents through the embeddings and add to the vectorstore. aadd_texts(texts[, metadatas]) Run more texts through th...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.deeplake.DeepLake.html
9b49231f99a2-3
Return VectorStore initialized from documents and embeddings. from_texts(texts[, embedding, metadatas, ...]) Create a Deep Lake dataset from a raw documents. max_marginal_relevance_search(query[, k, ...]) Return docs selected using maximal marginal relevance. max_marginal_relevance_search_by_vector(...) Return docs sel...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.deeplake.DeepLake.html
9b49231f99a2-4
Returns List of IDs of the added texts. Return type List[str] add_texts(texts: Iterable[str], metadatas: Optional[List[dict]] = None, ids: Optional[List[str]] = None, **kwargs: Any) → List[str][source]¶ Run more texts through the embeddings and add to the vectorstore. Examples >>> ids = deeplake_vectorstore.add_texts( ...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.deeplake.DeepLake.html
9b49231f99a2-5
Return docs selected using the maximal marginal relevance. async amax_marginal_relevance_search_by_vector(embedding: List[float], k: int = 4, fetch_k: int = 20, lambda_mult: float = 0.5, **kwargs: Any) → List[Document]¶ Return docs selected using the maximal marginal relevance. as_retriever(**kwargs: Any) → VectorStore...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.deeplake.DeepLake.html
9b49231f99a2-6
Return type bool delete_dataset() → None[source]¶ Delete the collection. classmethod force_delete_by_path(path: str) → None[source]¶ Force delete dataset by path. Parameters path (str) – path of the dataset to delete. Raises ValueError – if deeplake is not installed. classmethod from_documents(documents: List[Document]...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.deeplake.DeepLake.html
9b49231f99a2-7
in either the environment Local file system path of the form ./path/to/dataset or~/path/to/dataset or path/to/dataset. In-memory path of the form mem://path/to/dataset which doesn’tsave the dataset, but keeps it in memory instead. Should be used only for testing as it does not persist. texts (List[Document]) – List of ...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.deeplake.DeepLake.html
9b49231f99a2-8
fetch_k – Number of Documents for MMR algorithm. lambda_mult – Value between 0 and 1. 0 corresponds to maximum diversity and 1 to minimum. Defaults to 0.5. exec_option (str) – Supports 3 ways to perform searching. - “python” - Pure-python implementation running on the client. Can be used for data stored anywhere. WARNI...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.deeplake.DeepLake.html
9b49231f99a2-9
… k=<number_of_items_to_return>, … exec_option=<preferred_exec_option>, … ) Parameters embedding – Embedding to look up documents similar to. k – Number of Documents to return. Defaults to 4. fetch_k – Number of Documents to fetch for MMR algorithm. lambda_mult – Number between 0 and 1 determining the deg...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.deeplake.DeepLake.html
9b49231f99a2-10
Return docs most similar to query. Examples >>> # Search using an embedding >>> data = vector_store.similarity_search( ... query=<your_query>, ... k=<num_items>, ... exec_option=<preferred_exec_option>, ... ) >>> # Run tql search: >>> data = vector_store.tql_search( ... tql_query="SELECT * WHERE id == <...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.deeplake.DeepLake.html
9b49231f99a2-11
Use runtime = {“db_engine”: True} during dataset creation. Returns List of Documents most similar to the query vector. Return type List[Document] similarity_search_by_vector(embedding: Union[List[float], ndarray], k: int = 4, **kwargs: Any) → List[Document][source]¶ Return docs most similar to embedding vector. Example...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.deeplake.DeepLake.html
9b49231f99a2-12
used with in-memory or local datasets. ”tensor_db” - Performant, fully-hosted Managed Tensor Database.Responsible for storage and query execution. Only available for data stored in the Deep Lake Managed Database. To store datasets in this database, specify runtime = {“db_engine”: True} during dataset creation. distance...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.deeplake.DeepLake.html
9b49231f99a2-13
k (int) – Number of results to return. Defaults to 4. **kwargs – Additional keyword arguments. Some of these arguments are: distance_metric: L2 for Euclidean, L1 for Nuclear, max L-infinity distance, cos for cosine similarity, ‘dot’ for dot product. Defaults to L2. filter (Optional[Dict[str, str]]): Filter by metadata....
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.deeplake.DeepLake.html
59475d609aa0-0
langchain.vectorstores.annoy.dependable_annoy_import¶ langchain.vectorstores.annoy.dependable_annoy_import() → Any[source]¶ Import annoy if available, otherwise raise error.
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.annoy.dependable_annoy_import.html
478cc75ed024-0
langchain.vectorstores.mongodb_atlas.MongoDBAtlasVectorSearch¶ class langchain.vectorstores.mongodb_atlas.MongoDBAtlasVectorSearch(collection: Collection[MongoDBDocumentType], embedding: Embeddings, *, index_name: str = 'default', text_key: str = 'text', embedding_key: str = 'embedding')[source]¶ Bases: VectorStore Wra...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.mongodb_atlas.MongoDBAtlasVectorSearch.html
478cc75ed024-1
afrom_documents(documents, embedding, **kwargs) Return VectorStore initialized from documents and embeddings. afrom_texts(texts, embedding[, metadatas]) Return VectorStore initialized from texts and embeddings. amax_marginal_relevance_search(query[, k, ...]) Return docs selected using the maximal marginal relevance. am...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.mongodb_atlas.MongoDBAtlasVectorSearch.html
478cc75ed024-2
Return docs and relevance scores in the range [0, 1]. similarity_search_with_score(query, *[, k, ...]) Return MongoDB documents most similar to query, along with scores. async aadd_documents(documents: List[Document], **kwargs: Any) → List[str]¶ Run more documents through the embeddings and add to the vectorstore. Para...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.mongodb_atlas.MongoDBAtlasVectorSearch.html
478cc75ed024-3
Return VectorStore initialized from documents and embeddings. async classmethod afrom_texts(texts: List[str], embedding: Embeddings, metadatas: Optional[List[dict]] = None, **kwargs: Any) → VST¶ Return VectorStore initialized from texts and embeddings. async amax_marginal_relevance_search(query: str, k: int = 4, fetch_...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.mongodb_atlas.MongoDBAtlasVectorSearch.html
478cc75ed024-4
Parameters ids – List of ids to delete. Returns True if deletion is successful, False otherwise, None if not implemented. Return type Optional[bool] classmethod from_connection_string(connection_string: str, namespace: str, embedding: Embeddings, **kwargs: Any) → MongoDBAtlasVectorSearch[source]¶ classmethod from_docum...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.mongodb_atlas.MongoDBAtlasVectorSearch.html
478cc75ed024-5
Defaults to 0.5. Returns List of Documents selected by maximal marginal relevance. max_marginal_relevance_search_by_vector(embedding: List[float], k: int = 4, fetch_k: int = 20, lambda_mult: float = 0.5, **kwargs: Any) → List[Document]¶ Return docs selected using the maximal marginal relevance. Maximal marginal relevan...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.mongodb_atlas.MongoDBAtlasVectorSearch.html
478cc75ed024-6
Parameters query – Text to look up documents similar to. k – Optional Number of Documents to return. Defaults to 4. pre_filter – Optional Dictionary of argument(s) to prefilter on document fields. post_filter_pipeline – Optional Pipeline of MongoDB aggregation stages following the knnBeta search. Returns List of Docume...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.mongodb_atlas.MongoDBAtlasVectorSearch.html
478cc75ed024-7
This feature is in early access and available only for evaluation purposes, to validate functionality, and to gather feedback from a small closed group of early access users. It is not recommended for production deployments as we may introduce breaking changes. For more: https://www.mongodb.com/docs/atlas/atlas-search/...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.mongodb_atlas.MongoDBAtlasVectorSearch.html
13b7f5434f76-0
langchain.vectorstores.alibabacloud_opensearch.create_metadata¶ langchain.vectorstores.alibabacloud_opensearch.create_metadata(fields: Dict[str, Any]) → Dict[str, Any][source]¶ Create metadata from fields. Parameters fields – The fields of the document. The fields must be a dict. Returns The metadata of the document. T...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.alibabacloud_opensearch.create_metadata.html
f3ecbcdac98a-0
langchain.vectorstores.awadb.AwaDB¶ class langchain.vectorstores.awadb.AwaDB(table_name: str = 'langchain_awadb', embedding: Optional[Embeddings] = None, log_and_data_dir: Optional[str] = None, client: Optional[awadb.Client] = None)[source]¶ Bases: VectorStore Interface implemented by AwaDB vector stores. Initialize wi...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.awadb.AwaDB.html
f3ecbcdac98a-1
Return docs most similar to embedding vector. asimilarity_search_with_relevance_scores(query) Return docs most similar to query. create_table(table_name, **kwargs) Create a new table. delete(ids) Delete by vector ID. from_documents(documents[, embedding, ...]) Create an AwaDB vectorstore from a list of documents. from_...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.awadb.AwaDB.html
f3ecbcdac98a-2
Returns List of IDs of the added texts. Return type List[str] async aadd_texts(texts: Iterable[str], metadatas: Optional[List[dict]] = None, **kwargs: Any) → List[str]¶ Run more texts through the embeddings and add to the vectorstore. add_documents(documents: List[Document], **kwargs: Any) → List[str]¶ Run more documen...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.awadb.AwaDB.html
f3ecbcdac98a-3
Return docs selected using the maximal marginal relevance. async amax_marginal_relevance_search_by_vector(embedding: List[float], k: int = 4, fetch_k: int = 20, lambda_mult: float = 0.5, **kwargs: Any) → List[Document]¶ Return docs selected using the maximal marginal relevance. as_retriever(**kwargs: Any) → VectorStore...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.awadb.AwaDB.html
f3ecbcdac98a-4
Create an AwaDB vectorstore from a list of documents. If a log_and_data_dir specified, the table will be persisted there. Parameters documents (List[Document]) – List of documents to add to the vectorstore. embedding (Optional[Embeddings]) – Embedding function. Defaults to None. table_name (str) – Name of the table to ...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.awadb.AwaDB.html
f3ecbcdac98a-5
load_local(table_name: str, **kwargs: Any) → bool[source]¶ max_marginal_relevance_search(query: str, k: int = 4, fetch_k: int = 20, lambda_mult: float = 0.5, **kwargs: Any) → List[Document]¶ Return docs selected using the maximal marginal relevance. Maximal marginal relevance optimizes for similarity to query AND diver...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.awadb.AwaDB.html
f3ecbcdac98a-6
Return docs most similar to query using specified search type. similarity_search(query: str, k: int = 4, **kwargs: Any) → List[Document][source]¶ Return docs most similar to query. similarity_search_by_vector(embedding: Optional[List[float]] = None, k: int = 4, scores: Optional[list] = None, **kwargs: Any) → List[Docum...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.awadb.AwaDB.html
cd73d016d4d2-0
langchain.vectorstores.sklearn.BaseSerializer¶ class langchain.vectorstores.sklearn.BaseSerializer(persist_path: str)[source]¶ Bases: ABC Abstract base class for saving and loading data. Methods __init__(persist_path) extension() The file extension suggested by this serializer (without dot). load() Loads the data from ...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.sklearn.BaseSerializer.html
0204bd178800-0
langchain.vectorstores.faiss.FAISS¶ class langchain.vectorstores.faiss.FAISS(embedding_function: ~typing.Callable, index: ~typing.Any, docstore: ~langchain.docstore.base.Docstore, index_to_docstore_id: ~typing.Dict[int, str], relevance_score_fn: ~typing.Optional[~typing.Callable[[float], float]] = <function _default_re...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.faiss.FAISS.html
0204bd178800-1
Return docs selected using the maximal marginal relevance. amax_marginal_relevance_search_by_vector(...) Return docs selected using the maximal marginal relevance. as_retriever(**kwargs) asearch(query, search_type, **kwargs) Return docs most similar to query using specified search type. asimilarity_search(query[, k]) R...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.faiss.FAISS.html
0204bd178800-2
Return docs most similar to query. similarity_search_by_vector(embedding[, k, ...]) Return docs most similar to embedding vector. similarity_search_with_relevance_scores(query) Return docs and relevance scores in the range [0, 1]. similarity_search_with_score(query[, k, ...]) Return docs most similar to query. similari...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.faiss.FAISS.html
0204bd178800-3
ids – Optional list of unique IDs. Returns List of ids from adding the texts into the vectorstore. add_texts(texts: Iterable[str], metadatas: Optional[List[dict]] = None, ids: Optional[List[str]] = None, **kwargs: Any) → List[str][source]¶ Run more texts through the embeddings and add to the vectorstore. Parameters tex...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.faiss.FAISS.html
0204bd178800-4
Return docs most similar to query using specified search type. async asimilarity_search(query: str, k: int = 4, **kwargs: Any) → List[Document]¶ Return docs most similar to query. async asimilarity_search_by_vector(embedding: List[float], k: int = 4, **kwargs: Any) → List[Document]¶ Return docs most similar to embeddin...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.faiss.FAISS.html
0204bd178800-5
faiss = FAISS.from_embeddings(text_embedding_pairs, embeddings) classmethod from_texts(texts: List[str], embedding: Embeddings, metadatas: Optional[List[dict]] = None, ids: Optional[List[str]] = None, **kwargs: Any) → FAISS[source]¶ Construct FAISS wrapper from raw documents. This is a user friendly interface that: Emb...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.faiss.FAISS.html
0204bd178800-6
pass to MMR algorithm. lambda_mult – Number between 0 and 1 that determines the degree of diversity among the results with 0 corresponding to maximum diversity and 1 to minimum diversity. Defaults to 0.5. Returns List of Documents selected by maximal marginal relevance. max_marginal_relevance_search_by_vector(embedding...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.faiss.FAISS.html
0204bd178800-7
k – Number of Documents to return. Defaults to 4. fetch_k – Number of Documents to fetch before filtering to pass to MMR algorithm. lambda_mult – Number between 0 and 1 that determines the degree of diversity among the results with 0 corresponding to maximum diversity and 1 to minimum diversity. Defaults to 0.5. Return...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.faiss.FAISS.html
0204bd178800-8
Defaults to 20. Returns List of Documents most similar to the query. similarity_search_by_vector(embedding: List[float], k: int = 4, filter: Optional[Dict[str, Any]] = None, fetch_k: int = 20, **kwargs: Any) → List[Document][source]¶ Return docs most similar to embedding vector. Parameters embedding – Embedding to look...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.faiss.FAISS.html
0204bd178800-9
k – Number of Documents to return. Defaults to 4. filter (Optional[Dict[str, str]]) – Filter by metadata. Defaults to None. fetch_k – (Optional[int]) Number of Documents to fetch before filtering. Defaults to 20. Returns List of documents most similar to the query text with L2 distance in float. Lower score represents ...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.faiss.FAISS.html
5d650ce4fd1f-0
langchain.vectorstores.base.VectorStoreRetriever¶ class langchain.vectorstores.base.VectorStoreRetriever(*, vectorstore: VectorStore, search_type: str = 'similarity', search_kwargs: dict = None)[source]¶ Bases: BaseRetriever, BaseModel Create a new model by parsing and validating input data from keyword arguments. Rais...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.base.VectorStoreRetriever.html
d3493c26021d-0
langchain.vectorstores.vectara.Vectara¶ class langchain.vectorstores.vectara.Vectara(vectara_customer_id: Optional[str] = None, vectara_corpus_id: Optional[str] = None, vectara_api_key: Optional[str] = None)[source]¶ Bases: VectorStore Implementation of Vector Store using Vectara (https://vectara.com). .. rubric:: Exam...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.vectara.Vectara.html
d3493c26021d-1
Return docs most similar to query using specified search type. asimilarity_search(query[, k]) Return docs most similar to query. asimilarity_search_by_vector(embedding[, k]) Return docs most similar to embedding vector. asimilarity_search_with_relevance_scores(query) Return docs most similar to query. delete(ids) Delet...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.vectara.Vectara.html
d3493c26021d-2
Returns List of IDs of the added texts. Return type List[str] async aadd_texts(texts: Iterable[str], metadatas: Optional[List[dict]] = None, **kwargs: Any) → List[str]¶ Run more texts through the embeddings and add to the vectorstore. add_documents(documents: List[Document], **kwargs: Any) → List[str]¶ Run more documen...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.vectara.Vectara.html
d3493c26021d-3
Return docs selected using the maximal marginal relevance. async amax_marginal_relevance_search_by_vector(embedding: List[float], k: int = 4, fetch_k: int = 20, lambda_mult: float = 0.5, **kwargs: Any) → List[Document]¶ Return docs selected using the maximal marginal relevance. as_retriever(**kwargs: Any) → VectaraRetr...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.vectara.Vectara.html
d3493c26021d-4
Construct Vectara wrapper from raw documents. This is intended to be a quick way to get started. .. rubric:: Example from langchain import Vectara vectara = Vectara.from_texts( texts, vectara_customer_id=customer_id, vectara_corpus_id=corpus_id, vectara_api_key=api_key, ) max_marginal_relevance_search(q...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.vectara.Vectara.html
d3493c26021d-5
lambda_mult – Number between 0 and 1 that determines the degree of diversity among the results with 0 corresponding to maximum diversity and 1 to minimum diversity. Defaults to 0.5. Returns List of Documents selected by maximal marginal relevance. search(query: str, search_type: str, **kwargs: Any) → List[Document]¶ Re...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.vectara.Vectara.html
d3493c26021d-6
Return docs and relevance scores in the range [0, 1]. 0 is dissimilar, 1 is most similar. Parameters query – input text k – Number of Documents to return. Defaults to 4. **kwargs – kwargs to be passed to similarity search. Should include: score_threshold: Optional, a floating point value between 0 to 1 to filter the re...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.vectara.Vectara.html
01d42f6ac0d3-0
langchain.vectorstores.starrocks.StarRocks¶ class langchain.vectorstores.starrocks.StarRocks(embedding: Embeddings, config: Optional[StarRocksSettings] = None, **kwargs: Any)[source]¶ Bases: VectorStore Wrapper around StarRocks vector database You need a pymysql python package, and a valid account to connect to StarRoc...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.starrocks.StarRocks.html
01d42f6ac0d3-1
Return docs selected using the maximal marginal relevance. amax_marginal_relevance_search_by_vector(...) Return docs selected using the maximal marginal relevance. as_retriever(**kwargs) asearch(query, search_type, **kwargs) Return docs most similar to query using specified search type. asimilarity_search(query[, k]) R...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.starrocks.StarRocks.html
01d42f6ac0d3-2
(List[Document] (documents) – Documents to add to the vectorstore. Returns List of IDs of the added texts. Return type List[str] async aadd_texts(texts: Iterable[str], metadatas: Optional[List[dict]] = None, **kwargs: Any) → List[str]¶ Run more texts through the embeddings and add to the vectorstore. add_documents(docu...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.starrocks.StarRocks.html
01d42f6ac0d3-3
Return VectorStore initialized from texts and embeddings. async amax_marginal_relevance_search(query: str, k: int = 4, fetch_k: int = 20, lambda_mult: float = 0.5, **kwargs: Any) → List[Document]¶ Return docs selected using the maximal marginal relevance. async amax_marginal_relevance_search_by_vector(embedding: List[f...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.starrocks.StarRocks.html
01d42f6ac0d3-4
Helper function: Drop data escape_str(value: str) → str[source]¶ classmethod from_documents(documents: List[Document], embedding: Embeddings, **kwargs: Any) → VST¶ Return VectorStore initialized from documents and embeddings. classmethod from_texts(texts: List[str], embedding: Embeddings, metadatas: Optional[List[Dict[...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.starrocks.StarRocks.html
01d42f6ac0d3-5
of diversity among the results with 0 corresponding to maximum diversity and 1 to minimum diversity. Defaults to 0.5. Returns List of Documents selected by maximal marginal relevance. max_marginal_relevance_search_by_vector(embedding: List[float], k: int = 4, fetch_k: int = 20, lambda_mult: float = 0.5, **kwargs: Any) ...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.starrocks.StarRocks.html
01d42f6ac0d3-6
use {self.metadata_column}.attribute instead of attribute alone. The default name for it is metadata. Returns List of Documents Return type List[Document] similarity_search_by_vector(embedding: List[float], k: int = 4, where_str: Optional[str] = None, **kwargs: Any) → List[Document][source]¶ Perform a similarity search...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.starrocks.StarRocks.html
c8f9596f9b7b-0
langchain.vectorstores.clarifai.Clarifai¶ class langchain.vectorstores.clarifai.Clarifai(user_id: Optional[str] = None, app_id: Optional[str] = None, pat: Optional[str] = None, number_of_docs: Optional[int] = None, api_base: Optional[str] = None)[source]¶ Bases: VectorStore Wrapper around Clarifai AI platform’s vector ...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.clarifai.Clarifai.html
c8f9596f9b7b-1
Run more documents through the embeddings and add to the vectorstore. add_texts(texts[, metadatas, ids]) Add texts to the Clarifai vectorstore. afrom_documents(documents, embedding, **kwargs) Return VectorStore initialized from documents and embeddings. afrom_texts(texts, embedding[, metadatas]) Return VectorStore init...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.clarifai.Clarifai.html
c8f9596f9b7b-2
similarity_search_by_vector(embedding[, k]) Return docs most similar to embedding vector. similarity_search_with_relevance_scores(query) Return docs and relevance scores in the range [0, 1]. similarity_search_with_score(query[, k, ...]) Run similarity search with score using Clarifai. async aadd_documents(documents: Li...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.clarifai.Clarifai.html
c8f9596f9b7b-3
Parameters texts (Iterable[str]) – Texts to add to the vectorstore. metadatas (Optional[List[dict]], optional) – Optional list of metadatas. ids (Optional[List[str]], optional) – Optional list of IDs. Returns List of IDs of the added texts. Return type List[str] async classmethod afrom_documents(documents: List[Documen...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.clarifai.Clarifai.html
c8f9596f9b7b-4
Return docs most similar to query. async asimilarity_search_by_vector(embedding: List[float], k: int = 4, **kwargs: Any) → List[Document]¶ Return docs most similar to embedding vector. async asimilarity_search_with_relevance_scores(query: str, k: int = 4, **kwargs: Any) → List[Tuple[Document, float]]¶ Return docs most ...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.clarifai.Clarifai.html
c8f9596f9b7b-5
Returns Clarifai vectorstore. Return type Clarifai classmethod from_texts(texts: List[str], embedding: Optional[Embeddings] = None, metadatas: Optional[List[dict]] = None, user_id: Optional[str] = None, app_id: Optional[str] = None, pat: Optional[str] = None, number_of_docs: Optional[int] = None, api_base: Optional[str...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.clarifai.Clarifai.html
c8f9596f9b7b-6
of diversity among the results with 0 corresponding to maximum diversity and 1 to minimum diversity. Defaults to 0.5. Returns List of Documents selected by maximal marginal relevance. max_marginal_relevance_search_by_vector(embedding: List[float], k: int = 4, fetch_k: int = 20, lambda_mult: float = 0.5, **kwargs: Any) ...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.clarifai.Clarifai.html
c8f9596f9b7b-7
Parameters embedding – Embedding to look up documents similar to. k – Number of Documents to return. Defaults to 4. Returns List of Documents most similar to the query vector. similarity_search_with_relevance_scores(query: str, k: int = 4, **kwargs: Any) → List[Tuple[Document, float]]¶ Return docs and relevance scores ...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.clarifai.Clarifai.html
568505c854ba-0
langchain.vectorstores.singlestoredb.SingleStoreDB¶ class langchain.vectorstores.singlestoredb.SingleStoreDB(embedding: Embeddings, *, distance_strategy: DistanceStrategy = DistanceStrategy.DOT_PRODUCT, table_name: str = 'embeddings', content_field: str = 'content', metadata_field: str = 'metadata', vector_field: str =...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.singlestoredb.SingleStoreDB.html
568505c854ba-1
vector_field (str, optional) – Specifies the field to store the vector. Defaults to “vector”. pool (Following arguments pertain to the connection) – pool_size (int, optional) – Determines the number of active connections in the pool. Defaults to 5. max_overflow (int, optional) – Determines the maximum number of connec...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.singlestoredb.SingleStoreDB.html
568505c854ba-2
ssl_disabled (bool, optional) – Disables SSL usage. ssl_verify_cert (bool, optional) – Verifies the server’s certificate. Automatically enabled if ssl_ca is specified. ssl_verify_identity (bool, optional) – Verifies the server’s identity. conv (dict[int, Callable], optional) – A dictionary of data conversion functions....
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.singlestoredb.SingleStoreDB.html
568505c854ba-3
from langchain.vectorstores import SingleStoreDB os.environ['SINGLESTOREDB_URL'] = 'me:p455w0rd@s2-host.com/my_db' vectorstore = SingleStoreDB(OpenAIEmbeddings()) Methods __init__(embedding, *[, distance_strategy, ...]) Initialize with necessary components. aadd_documents(documents, **kwargs) Run more documents through...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.singlestoredb.SingleStoreDB.html
568505c854ba-4
Return VectorStore initialized from documents and embeddings. from_texts(texts, embedding[, metadatas, ...]) Create a SingleStoreDB vectorstore from raw documents. This is a user-friendly interface that: 1. Embeds documents. 2. Creates a new table for the embeddings in SingleStoreDB. 3. Adds the documents to the ne...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.singlestoredb.SingleStoreDB.html
568505c854ba-5
Run more texts through the embeddings and add to the vectorstore. add_documents(documents: List[Document], **kwargs: Any) → List[str]¶ Run more documents through the embeddings and add to the vectorstore. Parameters (List[Document] (documents) – Documents to add to the vectorstore. Returns List of IDs of the added text...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.singlestoredb.SingleStoreDB.html
568505c854ba-6
Return docs selected using the maximal marginal relevance. async amax_marginal_relevance_search_by_vector(embedding: List[float], k: int = 4, fetch_k: int = 20, lambda_mult: float = 0.5, **kwargs: Any) → List[Document]¶ Return docs selected using the maximal marginal relevance. as_retriever(**kwargs: Any) → SingleStore...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.singlestoredb.SingleStoreDB.html
568505c854ba-7
Return VectorStore initialized from documents and embeddings. classmethod from_texts(texts: List[str], embedding: Embeddings, metadatas: Optional[List[dict]] = None, distance_strategy: DistanceStrategy = DistanceStrategy.DOT_PRODUCT, table_name: str = 'embeddings', content_field: str = 'content', metadata_field: str = ...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.singlestoredb.SingleStoreDB.html
568505c854ba-8
Defaults to 0.5. Returns List of Documents selected by maximal marginal relevance. max_marginal_relevance_search_by_vector(embedding: List[float], k: int = 4, fetch_k: int = 20, lambda_mult: float = 0.5, **kwargs: Any) → List[Document]¶ Return docs selected using the maximal marginal relevance. Maximal marginal relevan...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.singlestoredb.SingleStoreDB.html
568505c854ba-9
Return docs most similar to embedding vector. Parameters embedding – Embedding to look up documents similar to. k – Number of Documents to return. Defaults to 4. Returns List of Documents most similar to the query vector. similarity_search_with_relevance_scores(query: str, k: int = 4, **kwargs: Any) → List[Tuple[Docume...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.singlestoredb.SingleStoreDB.html
e3cc07d99ef0-0
langchain.vectorstores.pinecone.Pinecone¶ class langchain.vectorstores.pinecone.Pinecone(index: Any, embedding_function: Callable, text_key: str, namespace: Optional[str] = None)[source]¶ Bases: VectorStore Wrapper around Pinecone vector database. To use, you should have the pinecone-client python package installed. Ex...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.pinecone.Pinecone.html
e3cc07d99ef0-1
amax_marginal_relevance_search_by_vector(...) Return docs selected using the maximal marginal relevance. as_retriever(**kwargs) asearch(query, search_type, **kwargs) Return docs most similar to query using specified search type. asimilarity_search(query[, k]) Return docs most similar to query. asimilarity_search_by_vec...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.pinecone.Pinecone.html
e3cc07d99ef0-2
Run more documents through the embeddings and add to the vectorstore. Parameters (List[Document] (documents) – Documents to add to the vectorstore. Returns List of IDs of the added texts. Return type List[str] async aadd_texts(texts: Iterable[str], metadatas: Optional[List[dict]] = None, **kwargs: Any) → List[str]¶ Run...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.pinecone.Pinecone.html
e3cc07d99ef0-3
Return VectorStore initialized from texts and embeddings. async amax_marginal_relevance_search(query: str, k: int = 4, fetch_k: int = 20, lambda_mult: float = 0.5, **kwargs: Any) → List[Document]¶ Return docs selected using the maximal marginal relevance. async amax_marginal_relevance_search_by_vector(embedding: List[f...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.pinecone.Pinecone.html
e3cc07d99ef0-4
Return VectorStore initialized from documents and embeddings. classmethod from_existing_index(index_name: str, embedding: Embeddings, text_key: str = 'text', namespace: Optional[str] = None) → Pinecone[source]¶ Load pinecone vectorstore from index name. classmethod from_texts(texts: List[str], embedding: Embeddings, me...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.pinecone.Pinecone.html
e3cc07d99ef0-5
k – Number of Documents to return. Defaults to 4. fetch_k – Number of Documents to fetch to pass to MMR algorithm. lambda_mult – Number between 0 and 1 that determines the degree of diversity among the results with 0 corresponding to maximum diversity and 1 to minimum diversity. Defaults to 0.5. Returns List of Documen...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.pinecone.Pinecone.html
e3cc07d99ef0-6
Parameters query – Text to look up documents similar to. k – Number of Documents to return. Defaults to 4. filter – Dictionary of argument(s) to filter on metadata namespace – Namespace to search in. Default will search in ‘’ namespace. Returns List of Documents most similar to the query and score for each similarity_s...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.pinecone.Pinecone.html
e3cc07d99ef0-7
filter – Dictionary of argument(s) to filter on metadata namespace – Namespace to search in. Default will search in ‘’ namespace. Returns List of Documents most similar to the query and score for each
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.pinecone.Pinecone.html
7fd9d4a411bb-0
langchain.vectorstores.opensearch_vector_search.OpenSearchVectorSearch¶ class langchain.vectorstores.opensearch_vector_search.OpenSearchVectorSearch(opensearch_url: str, index_name: str, embedding_function: Embeddings, **kwargs: Any)[source]¶ Bases: VectorStore Wrapper around OpenSearch as a vector database. Example fr...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.opensearch_vector_search.OpenSearchVectorSearch.html
7fd9d4a411bb-1
asimilarity_search(query[, k]) Return docs most similar to query. asimilarity_search_by_vector(embedding[, k]) Return docs most similar to embedding vector. asimilarity_search_with_relevance_scores(query) Return docs most similar to query. delete(ids) Delete by vector ID. from_documents(documents, embedding, **kwargs) ...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.opensearch_vector_search.OpenSearchVectorSearch.html
7fd9d4a411bb-2
Run more texts through the embeddings and add to the vectorstore. add_documents(documents: List[Document], **kwargs: Any) → List[str]¶ Run more documents through the embeddings and add to the vectorstore. Parameters (List[Document] (documents) – Documents to add to the vectorstore. Returns List of IDs of the added text...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.opensearch_vector_search.OpenSearchVectorSearch.html
7fd9d4a411bb-3
Return docs selected using the maximal marginal relevance. async amax_marginal_relevance_search_by_vector(embedding: List[float], k: int = 4, fetch_k: int = 20, lambda_mult: float = 0.5, **kwargs: Any) → List[Document]¶ Return docs selected using the maximal marginal relevance. as_retriever(**kwargs: Any) → VectorStore...
https://api.python.langchain.com/en/latest/vectorstores/langchain.vectorstores.opensearch_vector_search.OpenSearchVectorSearch.html