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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.