id
stringlengths
14
16
text
stringlengths
31
2.41k
source
stringlengths
54
121
1b035ff3a02e-29
Run query through SerpAPI and parse result async. Parameters query (str) – kwargs (Any) – Return type str get_params(query)[source] Get parameters for SerpAPI. Parameters query (str) – Return type Dict[str, str] results(query)[source] Run query through SerpAPI and return the raw result. Parameters query (str) – R...
https://api.python.langchain.com/en/latest/modules/utilities.html
1b035ff3a02e-30
Return type str run(command, fetch='all')[source] Parameters command (str) – fetch (str) – Return type str get_table_info_no_throw(table_names=None)[source] Get information about specified tables. Follows best practices as specified in: Rajkumar et al, 2022 (https://arxiv.org/abs/2204.00498) If sample_rows_in_table...
https://api.python.langchain.com/en/latest/modules/utilities.html
1b035ff3a02e-31
Parameters url (str) – kwargs (Any) – Return type str async aget(url, **kwargs)[source] GET the URL and return the text asynchronously. Parameters url (str) – kwargs (Any) – Return type str async apatch(url, data, **kwargs)[source] PATCH the URL and return the text asynchronously. Parameters url (str) – data (Di...
https://api.python.langchain.com/en/latest/modules/utilities.html
1b035ff3a02e-32
POST to the URL and return the text. Parameters url (str) – data (Dict[str, Any]) – kwargs (Any) – Return type str put(url, data, **kwargs)[source] PUT the URL and return the text. Parameters url (str) – data (Dict[str, Any]) – kwargs (Any) – Return type str property requests: langchain.requests.Requests class ...
https://api.python.langchain.com/en/latest/modules/utilities.html
1b035ff3a02e-33
format, an [alphanumeric sender ID](https://www.twilio.com/docs/sms/send-messages#use-an-alphanumeric-sender-id), or a [Channel Endpoint address](https://www.twilio.com/docs/sms/channels#channel-addresses) that is enabled for the type of message you want to send. Phone numbers or [short codes](https://www.twilio.com/do...
https://api.python.langchain.com/en/latest/modules/utilities.html
1b035ff3a02e-34
Parameters wiki_client (Any) – top_k_results (int) – lang (str) – load_all_available_meta (bool) – doc_content_chars_max (int) – Return type None attribute doc_content_chars_max: int = 4000 attribute lang: str = 'en' attribute load_all_available_meta: bool = False attribute top_k_results: int = 3 load(query)[s...
https://api.python.langchain.com/en/latest/modules/utilities.html
1b035ff3a02e-35
Parameters query (str) – Return type str class langchain.utilities.ZapierNLAWrapper(*, zapier_nla_api_key, zapier_nla_oauth_access_token, zapier_nla_api_base='https://nla.zapier.com/api/v1/')[source] Bases: pydantic.main.BaseModel Wrapper for Zapier NLA. Full docs here: https://nla.zapier.com/api/v1/docs Note: this w...
https://api.python.langchain.com/en/latest/modules/utilities.html
1b035ff3a02e-36
β€œdescription”: str, β€œparams”: Dict[str, str] }] params will always contain an instructions key, the only required param. All others optional and if provided will override any AI guesses (see β€œunderstanding the AI guessing flow” here: https://nla.zapier.com/api/v1/docs) Return type List[Dict] list_as_str()[source] Same...
https://api.python.langchain.com/en/latest/modules/utilities.html
1b035ff3a02e-37
Same as run, but returns a stringified version of the JSON for insertting back into an LLM. Return type str
https://api.python.langchain.com/en/latest/modules/utilities.html
c018b0edb28a-0
Vector Stores Wrappers on top of vector stores. class langchain.vectorstores.AlibabaCloudOpenSearch(embedding, config, **kwargs)[source] Bases: langchain.vectorstores.base.VectorStore Alibaba Cloud OpenSearch Vector Store Parameters embedding (langchain.embeddings.base.Embeddings) – config (langchain.vectorstores.al...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-1
score_threshold: Optional, a floating point value between 0 to 1 to filter the resulting set of retrieved docs search_filter (Optional[dict]) – kwargs (Any) – Returns List of Tuples of (doc, similarity_score) Return type List[Tuple[langchain.schema.Document, float]] similarity_search_by_vector(embedding, k=4, search_...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-2
metadatas (Optional[List[dict]]) – config (Optional[langchain.vectorstores.alibabacloud_opensearch.AlibabaCloudOpenSearchSettings]) – kwargs (Any) – Return type langchain.vectorstores.alibabacloud_opensearch.AlibabaCloudOpenSearch classmethod from_documents(documents, embedding, ids=None, config=None, **kwargs)[sour...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-3
vector store and opensearch instance configuration table field names: { β€˜id’: β€˜The id field name map of index document.’, β€˜document’: β€˜The text field name map of index document.’, β€˜embedding’: β€˜In the embedding field of the opensearch instance, the values must be in float16 multivalue type and separated by commas.’, β€˜m...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-4
collection_name is the name of the collection to use. (default: langchain) NOTE: This is not the name of the table, but the name of the collection.The tables will be created when initializing the store (if not exists) So, make sure the user has the right permissions to create tables. pre_delete_collection if True, will...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-5
k (int) – Number of results to return. Defaults to 4. filter (Optional[Dict[str, str]]) – Filter by metadata. Defaults to None. kwargs (Any) – Returns List of Documents most similar to the query. Return type List[langchain.schema.Document] similarity_search_with_score(query, k=4, filter=None)[source] Return docs most...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-6
Return VectorStore initialized from texts and embeddings. Postgres Connection string is required Either pass it as a parameter or set the PG_CONNECTION_STRING environment variable. Parameters texts (List[str]) – embedding (langchain.embeddings.base.Embeddings) – metadatas (Optional[List[dict]]) – embedding_dimension...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-7
user (str) – password (str) – Return type str class langchain.vectorstores.Annoy(embedding_function, index, metric, docstore, index_to_docstore_id)[source] Bases: langchain.vectorstores.base.VectorStore Wrapper around Annoy vector database. To use, you should have the annoy python package installed. Example from lan...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-8
Parameters query – Text to look up documents similar to. k (int) – Number of Documents to return. Defaults to 4. search_k (int) – inspect up to search_k nodes which defaults to n_trees * n if not provided embedding (List[float]) – Returns List of Documents most similar to the query and score for each Return type List[...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-9
Parameters embedding (List[float]) – Embedding to look up documents similar to. k (int) – Number of Documents to return. Defaults to 4. search_k (int) – inspect up to search_k nodes which defaults to n_trees * n if not provided kwargs (Any) – Returns List of Documents most similar to the embedding. Return type List[la...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-10
Maximal marginal relevance optimizes for similarity to query AND diversity among selected documents. Parameters embedding (List[float]) – Embedding to look up documents similar to. fetch_k (int) – Number of Documents to fetch to pass to MMR algorithm. k (int) – Number of Documents to return. Defaults to 4. lambda_mult ...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-11
Parameters texts (List[str]) – List of documents to index. embedding (langchain.embeddings.base.Embeddings) – Embedding function to use. metadatas (Optional[List[dict]]) – List of metadata dictionaries to associate with documents. metric (str) – Metric to use for indexing. Defaults to β€œangular”. trees (int) – Number of...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-12
Return type langchain.vectorstores.annoy.Annoy This is a user friendly interface that: Creates an in memory docstore with provided embeddings Initializes the Annoy database This is intended to be a quick way to get started. Example from langchain import Annoy from langchain.embeddings import OpenAIEmbeddings embeddings...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-13
Example from langchain.vectorstores import AtlasDB from langchain.embeddings.openai import OpenAIEmbeddings embeddings = OpenAIEmbeddings() vectorstore = AtlasDB("my_project", embeddings.embed_query) Parameters name (str) – embedding_function (Optional[Embeddings]) – api_key (Optional[str]) – description (str) – is...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-14
List of documents most similar to the query text. Return type List[Document] classmethod from_texts(texts, embedding=None, metadatas=None, ids=None, name=None, api_key=None, description='A description for your project', is_public=True, reset_project_if_exists=False, index_kwargs=None, **kwargs)[source] Create an Atlas...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-15
api_key (str) – Your nomic API key, documents (List[Document]) – List of documents to add to the vectorstore. embedding (Optional[Embeddings]) – Embedding function. Defaults to None. ids (Optional[List[str]]) – Optional list of document IDs. If None, ids will be auto created description (str) – A description for your p...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-16
:param kwargs: vectorstore specific parameters. Returns List of ids from adding the texts into the vectorstore. Parameters texts (Iterable[str]) – metadatas (Optional[List[dict]]) – is_duplicate_texts (Optional[bool]) – kwargs (Any) – Return type List[str] load_local(table_name, **kwargs)[source] Parameters table_...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-17
Parameters embedding (Optional[List[float]]) – Embedding to look up documents similar to. k (int) – Number of Documents to return. Defaults to 4. scores (Optional[list]) – kwargs (Any) – Returns List of Documents most similar to the query vector. Return type List[langchain.schema.Document] create_table(table_name, **...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-18
kwargs (Any) – Returns AwaDB vectorstore. Return type AwaDB classmethod from_documents(documents, embedding=None, table_name='langchain_awadb', logging_and_data_dir=None, client=None, **kwargs)[source] Create an AwaDB vectorstore from a list of documents. If a logging_and_data_dir specified, the table will be persist...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-19
similarity_search(query, k=4, **kwargs)[source] Return docs most similar to query. Parameters query (str) – k (int) – kwargs (Any) – Return type List[langchain.schema.Document] vector_search(query, k=4, **kwargs)[source] Returns the most similar indexed documents to the query text. Parameters query (str) – The que...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-20
Parameters query (str) – Text to look up documents similar to. k (int) – Number of Documents to return. Defaults to 4. filters (Optional[str]) – Returns List of Documents most similar to the query and score for each Return type List[Tuple[langchain.schema.Document, float]] semantic_hybrid_search(query, k=4, **kwargs)[...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-21
kwargs (Any) – Return type langchain.vectorstores.azuresearch.AzureSearch class langchain.vectorstores.Cassandra(embedding, session, keyspace, table_name, ttl_seconds=None)[source] Bases: langchain.vectorstores.base.VectorStore Wrapper around Cassandra embeddings platform. There is no notion of a default table name, ...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-22
Returns List of IDs of the added texts. Return type List[str] similarity_search_with_score_id_by_vector(embedding, k=4)[source] Return docs most similar to embedding vector. No support for filter query (on metadata) along with vector search. Parameters embedding (str) – Embedding to look up documents similar to. k (in...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-23
Return docs most similar to embedding vector. Parameters embedding (List[float]) – Embedding to look up documents similar to. k (int) – Number of Documents to return. Defaults to 4. kwargs (Any) – Returns List of Documents most similar to the query vector. Return type List[langchain.schema.Document] similarity_search_...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-24
Maximal marginal relevance optimizes for similarity to query AND diversity among selected documents. :param query: Text to look up documents similar to. :param k: Number of Documents to return. :param fetch_k: Number of Documents to fetch to pass to MMR algorithm. :param lambda_mult: Number between 0 and 1 that determi...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-25
Bases: langchain.vectorstores.base.VectorStore Wrapper around ChromaDB embeddings platform. To use, you should have the chromadb python package installed. Example from langchain.vectorstores import Chroma from langchain.embeddings.openai import OpenAIEmbeddings embeddings = OpenAIEmbeddings() vectorstore = Chroma("lang...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-26
Return docs most similar to embedding vector. :param embedding: Embedding to look up documents similar to. :type embedding: str :param k: Number of Documents to return. Defaults to 4. :type k: int :param filter: Filter by metadata. Defaults to None. :type filter: Optional[Dict[str, str]] Returns List of Documents most ...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-27
lambda_mult (float) – 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. filter (Optional[Dict[str, str]]) – Filter by metadata. Defaults to None. kwargs (Any) – Returns List of Documents selected by ma...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-28
where (Optional[Where]) – A Where type dict used to filter results by. E.g. {β€œcolor” : β€œred”, β€œprice”: 4.20}. Optional. limit (Optional[int]) – The number of documents to return. Optional. offset (Optional[int]) – The offset to start returning results from. Useful for paging results with limit. Optional. where_document...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-29
collection_name (str) – Name of the collection to create. persist_directory (Optional[str]) – Directory to persist the collection. embedding (Optional[Embeddings]) – Embedding function. Defaults to None. metadatas (Optional[List[dict]]) – List of metadatas. Defaults to None. ids (Optional[List[str]]) – List of document...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-30
Bases: langchain.vectorstores.base.VectorStore Wrapper around ClickHouse vector database You need a clickhouse-connect python package, and a valid account to connect to ClickHouse. ClickHouse can not only search with simple vector indexes, it also supports complex query with multiple conditions, constraints and even su...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-31
Defaults to None. batch_size (int, optional) – Batchsize when transmitting data to ClickHouse. Defaults to 32. metadata (List[dict], optional) – metadata to texts. Defaults to None. into (Other keyword arguments will pass) – [clickhouse-connect](https://clickhouse.com/docs/en/integrations/python#clickhouse-connect-driv...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-32
of SQL injection. When dealing with metadatas, remember to use {self.metadata_column}.attribute instead of attribute alone. The default name for it is metadata. embedding (List[float]) – kwargs (Any) – Returns List of (Document, similarity) Return type List[Document] similarity_search_with_relevance_scores(query, k=4...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-33
index_param (list): index build parameter. index_query_params(dict): index query parameters. database (str) : Database name to find the table. Defaults to β€˜default’. table (str) : Table name to operate on. Defaults to β€˜vector_table’. metric (str)Metric to compute distance,supported are (β€˜angular’, β€˜euclidean’, β€˜manhatt...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-34
Show JSON schema{ "title": "ClickhouseSettings", "description": "ClickHouse Client Configuration\n\nAttribute:\n clickhouse_host (str) : An URL to connect to MyScale backend.\n Defaults to 'localhost'.\n clickhouse_port (int) : URL port to connect with HTTP. Defaults to 8443.\n us...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-35
"type": "object", "properties": { "host": { "title": "Host", "default": "localhost", "env_names": "{'clickhouse_host'}", "type": "string" }, "port": { "title": "Port", "default": 8123, "env_names": "{'clickhouse_port'}", "type"...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-36
"type": "string" } }, "column_map": { "title": "Column Map", "default": { "id": "id", "uuid": "uuid", "document": "document", "embedding": "embedding", "metadata": "metadata" }, "env_names": "{'clickhous...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-37
port (int) table (str) username (Optional[str]) attribute column_map: Dict[str, str] = {'document': 'document', 'embedding': 'embedding', 'id': 'id', 'metadata': 'metadata', 'uuid': 'uuid'} attribute database: str = 'default' attribute host: str = 'localhost' attribute index_param: Optional[Union[List, Dict]] = ["'L...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-38
To use, you should have the deeplake python package installed. Example from langchain.vectorstores import DeepLake from langchain.embeddings.openai import OpenAIEmbeddings embeddings = OpenAIEmbeddings() vectorstore = DeepLake("langchain_store", embeddings.embed_query) Parameters dataset_path (str) – token (Optional[s...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-39
... ) >>> # Run tql search: >>> data = vector_store.tql_search( ... tql_query="SELECT * WHERE id == <id>", ... exec_option="compute_engine", ... ) Parameters k (int) – Number of Documents to return. Defaults to 4. query (str) – Text to look up similar documents. **kwargs – Additional keyword arguments include: ...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-40
similarity_search_by_vector(embedding, k=4, **kwargs)[source] Return docs most similar to embedding vector. Examples >>> # Search using an embedding >>> data = vector_store.similarity_search_by_vector( ... embedding=<your_embedding>, ... k=<num_items_to_return>, ... exec_option=<preferred_exec_option>, ... ) ...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-41
runtime = {β€œdb_engine”: True} during dataset creation. distance_metric (str): L2 for Euclidean, L1 for Nuclear,max for L-infinity distance, cos for cosine similarity, β€˜dot’ for dot product. Defaults to L2. kwargs (Any) – Returns List of Documents most similar to the query vector. Return type List[Document] similarity_...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-42
any data stored in or connected to Deep Lake. It cannot be 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 runt...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-43
β€œpython”. - β€œpython” - Pure-python implementation running on the client. Can be used for data stored anywhere. WARNING: using this option with big datasets is discouraged due to potential memory issues. ”compute_engine” - Performant C++ implementation of the DeepLake Compute Engine. Runs on the client and can be used f...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-44
lambda_mult (float) – 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. WARNING: using this option with big datasets i...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-45
… exec_option = <preferred_exec_option>, … ) Parameters dataset_path (str) – The full path to the dataset. Can be: Deep Lake cloud path of the form hub://username/dataset_name.To write to Deep Lake cloud datasets, ensure that you are logged in to Deep Lake (use β€˜activeloop login’ from command line) AWS S3 path ...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-46
filter (Optional[Dict[str, str]], optional) – The filter to delete by. Defaults to None. delete_all (Optional[bool], optional) – Whether to drop the dataset. Defaults to None. Returns Whether the delete operation was successful. Return type bool classmethod force_delete_by_path(path)[source] Force delete dataset by pa...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-47
β€œcosine”, β€œip”, and β€œl2”. Defaults to β€œcosine”. max_elements (int) – Maximum number of vectors that can be stored. Defaults to 1024. index (bool) – Whether an index should be built for this field. Defaults to True. ef_construction (int) – defines a construction time/accuracy trade-off. Defaults to 200. ef (int) – param...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-48
Return type langchain.vectorstores.docarray.hnsw.DocArrayHnswSearch class langchain.vectorstores.DocArrayInMemorySearch(doc_index, embedding)[source] Bases: langchain.vectorstores.docarray.base.DocArrayIndex Wrapper around in-memory storage for exact search. To use it, you should have the docarray package with version...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-49
Defaults to β€œcosine_sim”. kwargs (Any) – Returns DocArrayInMemorySearch Vector Store Return type langchain.vectorstores.docarray.in_memory.DocArrayInMemorySearch class langchain.vectorstores.ElasticVectorSearch(elasticsearch_url, index_name, embedding, *, ssl_verify=None)[source] Bases: langchain.vectorstores.base.Ve...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-50
Follow the prompts to reset the password The format for Elastic Cloud URLs is https://username:password@cluster_id.region_id.gcp.cloud.es.io:9243. Example from langchain import ElasticVectorSearch from langchain.embeddings import OpenAIEmbeddings embedding = OpenAIEmbeddings() elastic_host = "cluster_id.region_id.gcp.c...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-51
Return docs most similar to query. Parameters query (str) – Text to look up documents similar to. k (int) – Number of Documents to return. Defaults to 4. filter (Optional[dict]) – kwargs (Any) – Returns List of Documents most similar to the query. Return type List[langchain.schema.Document] similarity_search_with_sco...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-52
elasticsearch_url (Optional[str]) – index_name (Optional[str]) – refresh_indices (bool) – kwargs (Any) – Return type langchain.vectorstores.elastic_vector_search.ElasticVectorSearch create_index(client, index_name, mapping)[source] Parameters client (Any) – index_name (str) – mapping (Dict) – Return type None c...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-53
Run more texts through the embeddings and add to the vectorstore. Parameters texts (Iterable[str]) – Iterable of strings to add to the vectorstore. metadatas (Optional[List[dict]]) – Optional list of metadatas associated with the texts. ids (Optional[List[str]]) – Optional list of unique IDs. kwargs (Any) – Returns Li...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-54
filter the resulting set of retrieved docs kwargs (Any) – Returns List of documents most similar to the query text and L2 distance in float for each. Lower score represents more similarity. Return type List[Tuple[langchain.schema.Document, float]] similarity_search_with_score(query, k=4, filter=None, fetch_k=20, **kwa...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-55
Return docs most similar to query. Parameters query (str) – Text to look up documents similar to. k (int) – Number of Documents to return. Defaults to 4. filter (Optional[Dict[str, Any]]) – (Optional[Dict[str, str]]): Filter by metadata. Defaults to None. fetch_k (int) – (Optional[int]) Number of Documents to fetch bef...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-56
Maximal marginal relevance optimizes for similarity to query AND diversity among selected documents. Parameters query (str) – Text to look up documents similar to. k (int) – Number of Documents to return. Defaults to 4. fetch_k (int) – Number of Documents to fetch before filtering (if needed) to pass to MMR algorithm. ...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-57
ids (Optional[List[str]]) – kwargs (Any) – Return type langchain.vectorstores.faiss.FAISS classmethod from_embeddings(text_embeddings, embedding, metadatas=None, ids=None, **kwargs)[source] Construct FAISS wrapper from raw documents. This is a user friendly interface that: Embeds documents. Creates an in memory docs...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-58
and index_to_docstore_id from. embeddings (langchain.embeddings.base.Embeddings) – Embeddings to use when generating queries index_name (str) – for saving with a specific index file name Return type langchain.vectorstores.faiss.FAISS class langchain.vectorstores.Hologres(connection_string, embedding_function, ndims=153...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-59
embeddings (List[List[float]]) – List of list of embedding vectors. metadatas (List[dict]) – List of metadatas associated with the texts. kwargs (Any) – vectorstore specific parameters ids (List[str]) – Return type None add_texts(texts, metadatas=None, ids=None, **kwargs)[source] Run more texts through the embeddings...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-60
Returns List of Documents most similar to the query vector. Return type List[langchain.schema.Document] similarity_search_with_score(query, k=4, filter=None)[source] Return docs most similar to query. Parameters query (str) – Text to look up documents similar to. k (int) – Number of Documents to return. Defaults to 4....
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-61
Return type langchain.vectorstores.hologres.Hologres classmethod from_embeddings(text_embeddings, embedding, metadatas=None, ndims=1536, table_name='langchain_pg_embedding', ids=None, pre_delete_table=False, **kwargs)[source] Construct Hologres wrapper from raw documents and pre- generated embeddings. Return VectorSto...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-62
Return type langchain.vectorstores.hologres.Hologres classmethod get_connection_string(kwargs)[source] Parameters kwargs (Dict[str, Any]) – Return type str classmethod from_documents(documents, embedding, ndims=1536, table_name='langchain_pg_embedding', ids=None, pre_delete_collection=False, **kwargs)[source] Return...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-63
result = vectorstore.similarity_search('text1') Parameters connection (Any) – embedding (Embeddings) – vector_key (Optional[str]) – id_key (Optional[str]) – text_key (Optional[str]) – add_texts(texts, metadatas=None, ids=None, **kwargs)[source] Turn texts into embedding and add it to the database Parameters texts...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-64
Return type langchain.vectorstores.lancedb.LanceDB class langchain.vectorstores.MatchingEngine(project_id, index, endpoint, embedding, gcs_client, gcs_bucket_name, credentials=None)[source] Bases: langchain.vectorstores.base.VectorStore Vertex Matching Engine implementation of the vector store. While the embeddings ar...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-65
k (int) – The amount of neighbors that will be retrieved. kwargs (Any) – Returns A list of k matching documents. Return type List[langchain.schema.Document] classmethod from_texts(texts, embedding, metadatas=None, **kwargs)[source] Use from components instead. Parameters texts (List[str]) – embedding (langchain.embe...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-66
Return type langchain.vectorstores.matching_engine.MatchingEngine class langchain.vectorstores.Milvus(embedding_function, collection_name='LangChainCollection', connection_args=None, consistency_level='Session', index_params=None, search_params=None, drop_old=False)[source] Bases: langchain.vectorstores.base.VectorSto...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-67
Returns The resulting keys for each inserted element. Return type List[str] similarity_search(query, k=4, param=None, expr=None, timeout=None, **kwargs)[source] Perform a similarity search against the query string. Parameters query (str) – The text to search. k (int, optional) – How many results to return. Defaults to...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-68
documentation found here: https://milvus.io/api-reference/pymilvus/v2.2.6/Collection/search().md Parameters query (str) – The text being searched. k (int, optional) – The amount of results ot return. Defaults to 4. param (dict) – The search params for the specified index. Defaults to None. expr (str, optional) – Filter...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-69
Returns Result doc and score. Return type List[Tuple[Document, float]] max_marginal_relevance_search(query, k=4, fetch_k=20, lambda_mult=0.5, param=None, expr=None, timeout=None, **kwargs)[source] Perform a search and return results that are reordered by MMR. Parameters query (str) – The text being searched. k (int, o...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-70
lambda_mult (float) – 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 param (dict, optional) – The search params for the specified index. Defaults to None. expr (str, optional) – Filtering expression. ...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-71
Defaults to None. drop_old (Optional[bool], optional) – Whether to drop the collection with that name if it exists. Defaults to False. kwargs (Any) – Returns Milvus Vector Store Return type Milvus class langchain.vectorstores.Zilliz(embedding_function, collection_name='LangChainCollection', connection_args=None, consi...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-72
Defaults to None. search_params (Optional[dict], optional) – Which search params to use. Defaults to None. drop_old (Optional[bool], optional) – Whether to drop the collection with that name if it exists. Defaults to False. kwargs (Any) – Returns Zilliz Vector Store Return type Zilliz class langchain.vectorstores.Sing...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-73
Parameters texts (Iterable[str]) – Iterable of strings/text to add to the vectorstore. metadatas (Optional[List[dict]], optional) – Optional list of metadatas. Defaults to None. embeddings (Optional[List[List[float]]], optional) – Optional pre-generated embeddings. Defaults to None. kwargs (Any) – Returns empty list R...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-74
Create a SingleStoreDB vectorstore from raw documents. This is a user-friendly interface that: Embeds documents. Creates a new table for the embeddings in SingleStoreDB. Adds the documents to the newly created table. This is intended to be a quick way to get started. .. rubric:: Example Parameters texts (List[str]) – ...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-75
pat (Optional[str]) – number_of_docs (Optional[int]) – api_base (Optional[str]) – Return type None add_texts(texts, metadatas=None, ids=None, **kwargs)[source] Add texts to the Clarifai vectorstore. This will push the text to a Clarifai application. Application use base workflow that create and store embedding for ...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-76
Returns List of Documents most similar to the query and score for each Return type List[langchain.schema.Document] classmethod from_texts(texts, embedding=None, metadatas=None, user_id=None, app_id=None, pat=None, number_of_docs=None, api_base=None, **kwargs)[source] Create a Clarifai vectorstore from a list of texts....
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-77
kwargs (Any) – Returns Clarifai vectorstore. Return type Clarifai class langchain.vectorstores.OpenSearchVectorSearch(opensearch_url, index_name, embedding_function, **kwargs)[source] Bases: langchain.vectorstores.base.VectorStore Wrapper around OpenSearch as a vector database. Example from langchain import OpenSearc...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-78
Also supports Script Scoring and Painless Scripting. Parameters query (str) – Text to look up documents similar to. k (int) – Number of Documents to return. Defaults to 4. kwargs (Any) – Returns List of Documents most similar to the query. Return type List[langchain.schema.Document] Optional Args:vector_field: Documen...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-79
pre_filter: script_score query to pre-filter documents before identifying nearest neighbors; default: {β€œmatch_all”: {}} similarity_search_with_score(query, k=4, **kwargs)[source] Return docs and it’s scores most similar to query. By default, supports Approximate Search. Also supports Script Scoring and Painless Script...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-80
Construct OpenSearchVectorSearch wrapper from raw documents. Example from langchain import OpenSearchVectorSearch from langchain.embeddings import OpenAIEmbeddings embeddings = OpenAIEmbeddings() opensearch_vector_search = OpenSearchVectorSearch.from_texts( texts, embeddings, opensearch_url="http://localhos...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-81
bulk_size (int) – kwargs (Any) – Return type langchain.vectorstores.opensearch_vector_search.OpenSearchVectorSearch class langchain.vectorstores.MongoDBAtlasVectorSearch(collection, embedding, *, index_name='default', text_key='text', embedding_key='embedding')[source] Bases: langchain.vectorstores.base.VectorStore ...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-82
kwargs (Any) – Returns List of ids from adding the texts into the vectorstore. Return type List similarity_search_with_score(query, *, k=4, pre_filter=None, post_filter_pipeline=None)[source] Return MongoDB documents most similar to query, along with scores. Use the knnBeta Operator available in MongoDB Atlas Search ...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-83
Parameters query (str) – Text to look up documents similar to. k (int) – Optional Number of Documents to return. Defaults to 4. pre_filter (Optional[dict]) – Optional Dictionary of argument(s) to prefilter on document fields. post_filter_pipeline (Optional[List[Dict]]) – Optional Pipeline of MongoDB aggregation stages ...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-84
kwargs (Any) – Return type None escape_str(value)[source] Parameters value (str) – Return type str add_texts(texts, metadatas=None, batch_size=32, ids=None, **kwargs)[source] Run more texts through the embeddings and add to the vectorstore. Parameters texts (Iterable[str]) – Iterable of strings to add to the vector...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-85
kwargs (Any) – Returns MyScale Index Return type langchain.vectorstores.myscale.MyScale similarity_search(query, k=4, where_str=None, **kwargs)[source] Perform a similarity search with MyScale Parameters query (str) – query string k (int, optional) – Top K neighbors to retrieve. Defaults to 4. where_str (Optional[str...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-86
Perform a similarity search with MyScale Parameters query (str) – query string k (int, optional) – Top K neighbors to retrieve. Defaults to 4. where_str (Optional[str], optional) – where condition string. Defaults to None. NOTE – Please do not let end-user to fill this and always be aware of SQL injection. When dealing...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-87
must be same size to number of columns. For example: .. code-block:: python {β€˜id’: β€˜text_id’, β€˜vector’: β€˜text_embedding’, β€˜text’: β€˜text_plain’, β€˜metadata’: β€˜metadata_dictionary_in_json’, } Defaults to identity map. Show JSON schema{ "title": "MyScaleSettings", "description": "MyScale Client Configuration\n\nAttri...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-88
"type": "object", "properties": { "host": { "title": "Host", "default": "localhost", "env_names": "{'myscale_host'}", "type": "string" }, "port": { "title": "Port", "default": 8443, "env_names": "{'myscale_port'}", "type": "int...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-89
"type": "string" } }, "database": { "title": "Database", "default": "default", "env_names": "{'myscale_database'}", "type": "string" }, "table": { "title": "Table", "default": "langchain", "env_names": "{'myscale_table'}", ...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
c018b0edb28a-90
attribute table: str = 'langchain' attribute username: Optional[str] = None class langchain.vectorstores.Pinecone(index, embedding_function, text_key, namespace=None)[source] Bases: langchain.vectorstores.base.VectorStore Wrapper around Pinecone vector database. To use, you should have the pinecone-client python pac...
https://api.python.langchain.com/en/latest/modules/vectorstores.html