id
stringlengths
14
16
text
stringlengths
4
1.28k
source
stringlengths
54
121
4212bb82ae73-61
Parameters url (str) – data (Dict[str, Any]) – kwargs (Any) – Return type str delete(url, **kwargs)[source] DELETE the URL and return the text. Parameters url (str) – kwargs (Any) – Return type str get(url, **kwargs)[source] GET the URL and return the text. Parameters url (str) – kwargs (Any) – Return type str...
https://api.python.langchain.com/en/latest/modules/utilities.html
4212bb82ae73-62
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 langchain.utilities.TwilioAPIWrapper(...
https://api.python.langchain.com/en/latest/modules/utilities.html
4212bb82ae73-63
named parameters to the constructor. Example from langchain.utilities.twilio import TwilioAPIWrapper twilio = TwilioAPIWrapper( account_sid="ACxxx", auth_token="xxx", from_number="+10123456789" ) twilio.run('test', '+12484345508') Parameters client (Any) – account_sid (Optional[str]) – auth_token (Optiona...
https://api.python.langchain.com/en/latest/modules/utilities.html
4212bb82ae73-64
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
4212bb82ae73-65
[E.164](https://www.twilio.com/docs/glossary/what-e164) format for SMS/MMS or [Channel user address](https://www.twilio.com/docs/sms/channels#channel-addresses) for other 3rd-party channels. Return type str class langchain.utilities.WikipediaAPIWrapper(*, wiki_client=None, top_k_results=3, lang='en', load_all_available...
https://api.python.langchain.com/en/latest/modules/utilities.html
4212bb82ae73-66
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)[source] Run Wikipedia search and...
https://api.python.langchain.com/en/latest/modules/utilities.html
4212bb82ae73-67
Return type str class langchain.utilities.WolframAlphaAPIWrapper(*, wolfram_client=None, wolfram_alpha_appid=None)[source] Bases: pydantic.main.BaseModel Wrapper for Wolfram Alpha. Docs for using: Go to wolfram alpha and sign up for a developer account Create an app and get your APP ID Save your APP ID into WOLFRAM_AL...
https://api.python.langchain.com/en/latest/modules/utilities.html
4212bb82ae73-68
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 wrapper currently only impl...
https://api.python.langchain.com/en/latest/modules/utilities.html
4212bb82ae73-69
Parameters zapier_nla_api_key (str) – zapier_nla_oauth_access_token (str) – zapier_nla_api_base (str) – Return type None attribute zapier_nla_api_base: str = 'https://nla.zapier.com/api/v1/' attribute zapier_nla_api_key: str [Required] attribute zapier_nla_oauth_access_token: str [Required] list()[source] Return...
https://api.python.langchain.com/en/latest/modules/utilities.html
4212bb82ae73-70
}] 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 as list, but returns a stringified version o...
https://api.python.langchain.com/en/latest/modules/utilities.html
4212bb82ae73-71
Same as preview, but returns a stringified version of the JSON for insertting back into an LLM. Return type str run(action_id, instructions, params=None)[source] Executes an action that is identified by action_id, must be exposed (enabled) by the current user (associated with the set api_key). Change your exposed acti...
https://api.python.langchain.com/en/latest/modules/utilities.html
4a1bad429950-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
4a1bad429950-1
Returns List of ids from adding the texts into the vectorstore. Return type List[str] similarity_search(query, k=4, search_filter=None, **kwargs)[source] Return docs most similar to query. Parameters query (str) – k (int) – search_filter (Optional[Dict[str, Any]]) – kwargs (Any) – Return type List[langchain.schema...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
4a1bad429950-2
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
4a1bad429950-3
Parameters embedding (List[float]) – search_filter (Optional[Dict[str, Any]]) – k (int) – Return type Dict[str, Any] create_results(json_result)[source] Parameters json_result (Dict[str, Any]) – Return type List[langchain.schema.Document] create_results_with_score(json_result)[source] Parameters json_result (Dict...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
4a1bad429950-4
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)[source] Return VectorStore initialized ...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
4a1bad429950-5
class langchain.vectorstores.AlibabaCloudOpenSearchSettings(endpoint, instance_id, username, password, datasource_name, embedding_index_name, field_name_mapping)[source] Bases: object Opensearch Client Configuration Attribute: endpoint (str) : The endpoint of opensearch instance, You can find it from the console of Al...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
4a1bad429950-6
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
4a1bad429950-7
instance_id: str username: str password: str datasource_name: str embedding_index_name: str field_name_mapping: Dict[str, str] = {'document': 'document', 'embedding': 'embedding', 'id': 'id', 'metadata_field_x': 'metadata_field_x,operator'} class langchain.vectorstores.AnalyticDB(connection_string, embedding_func...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
4a1bad429950-8
langchain.embeddings.base.Embeddings interface. 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 cr...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
4a1bad429950-9
Return type None add_texts(texts, metadatas=None, ids=None, batch_size=500, **kwargs)[source] 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...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
4a1bad429950-10
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 similar to query. Parameters query (str) – Text to lo...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
4a1bad429950-11
k (int) – filter (Optional[dict]) – Return type List[Tuple[langchain.schema.Document, float]] similarity_search_by_vector(embedding, k=4, filter=None, **kwargs)[source] Return docs most similar to embedding vector. Parameters embedding (List[float]) – Embedding to look up documents similar to. k (int) – Number of Do...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
4a1bad429950-12
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
4a1bad429950-13
Return VectorStore initialized from documents and embeddings. Postgres Connection string is required Either pass it as a parameter or set the PG_CONNECTION_STRING environment variable. Parameters documents (List[langchain.schema.Document]) – embedding (langchain.embeddings.base.Embeddings) – embedding_dimension (int)...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
4a1bad429950-14
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 langchain import Annoy db = Annoy(e...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
4a1bad429950-15
metadatas (Optional[List[dict]]) – Optional list of metadatas associated with the texts. kwargs (Any) – vectorstore specific parameters Returns List of ids from adding the texts into the vectorstore. Return type List[str] process_index_results(idxs, dists)[source] Turns annoy results into a list of documents and score...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
4a1bad429950-16
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[Tuple[langchain.schema.Document, float]] similarity_searc...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
4a1bad429950-17
Return type List[Tuple[langchain.schema.Document, float]] similarity_search_with_score(query, k=4, search_k=- 1)[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. search_k (int) – inspect up to search_k node...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
4a1bad429950-18
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[langchain.schema.Document] similarity_search_by_index(docstore_index, k=4, search_...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
4a1bad429950-19
List[langchain.schema.Document] similarity_search(query, k=4, search_k=- 1, **kwargs)[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. search_k (int) – inspect up to search_k nodes which defaults to n_trees...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
4a1bad429950-20
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 (float) – Number between 0 and 1 that determines the degree of diversity am...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
4a1bad429950-21
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 to pass to MMR algorithm. lambda_mult (float) – Number between 0 and 1 that determines the degree of diversity among the results w...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
4a1bad429950-22
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 trees to use for indexing. Defaults to 100. n_jobs (int) –...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
4a1bad429950-23
classmethod from_embeddings(text_embeddings, embedding, metadatas=None, metric='angular', trees=100, n_jobs=- 1, **kwargs)[source] Construct Annoy wrapper from embeddings. Parameters text_embeddings (List[Tuple[str, List[float]]]) – List of tuples of (text, embedding) embedding (langchain.embeddings.base.Embeddings) –...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
4a1bad429950-24
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 = OpenAIEmbeddings() text_embeddings = embeddi...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
4a1bad429950-25
Return type None classmethod load_local(folder_path, embeddings)[source] Load Annoy index, docstore, and index_to_docstore_id to disk. Parameters folder_path (str) – folder path to load index, docstore, and index_to_docstore_id from. embeddings (langchain.embeddings.base.Embeddings) – Embeddings to use when generating...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
4a1bad429950-26
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_public ...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
4a1bad429950-27
refresh (bool) – Whether or not to refresh indices with the updated data. Default True. kwargs (Any) – Returns List of IDs of the added texts. Return type List[str] create_index(**kwargs)[source] Creates an index in your project. See https://docs.nomic.ai/atlas_api.html#nomic.project.AtlasProject.create_index for ful...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
4a1bad429950-28
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 AtlasDB vectorstore from a raw documents. Parameters te...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
4a1bad429950-29
is_public (bool) – Whether your project is publicly accessible. True by default. reset_project_if_exists (bool) – Whether to reset this project if it already exists. Default False. Generally userful during development and testing. index_kwargs (Optional[dict]) – Dict of kwargs for index creation. See https://docs.nomic...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
4a1bad429950-30
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 project. is_public (bool) – Whether y...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
4a1bad429950-31
Return type AtlasDB class langchain.vectorstores.AwaDB(table_name='langchain_awadb', embedding_model=None, log_and_data_dir=None, client=None)[source] Bases: langchain.vectorstores.base.VectorStore Interface implemented by AwaDB vector stores. Parameters table_name (str) – embedding_model (Optional[Embeddings]) – lo...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
4a1bad429950-32
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_name (str) – kwargs (Any) – Return type bool s...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
4a1bad429950-33
0 is dissimilar, 1 is most similar. Parameters query (str) – k (int) – kwargs (Any) – Return type List[Tuple[langchain.schema.Document, float]] similarity_search_with_relevance_scores(query, k=4, **kwargs)[source] Return docs and relevance scores, normalized on a scale from 0 to 1. 0 is dissimilar, 1 is most simila...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
4a1bad429950-34
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, **kwargs)[source] Create a new table. Parameters table_name (str) – kwargs (Any) – Return...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
4a1bad429950-35
Get the current table. Parameters kwargs (Any) – Return type str classmethod from_texts(texts, embedding=None, metadatas=None, table_name='langchain_awadb', logging_and_data_dir=None, client=None, **kwargs)[source] Create an AwaDB vectorstore from a raw documents. Parameters texts (List[str]) – List of texts to add t...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
4a1bad429950-36
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 persisted there. Parameters documents (List[Docume...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
4a1bad429950-37
Return type AwaDB class langchain.vectorstores.AzureSearch(azure_search_endpoint, azure_search_key, index_name, embedding_function, search_type='hybrid', semantic_configuration_name=None, semantic_query_language='en-us', **kwargs)[source] Bases: langchain.vectorstores.base.VectorStore Parameters azure_search_endpoint ...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
4a1bad429950-38
Return type List[str] 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...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
4a1bad429950-39
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. filters (Optional[str]) – Returns List of Documents most similar to the query and score for each Return type List[Tuple[langchain.schema.Document, float]] hybrid_sea...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
4a1bad429950-40
Return docs most similar to query with an hybrid query. 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.Documen...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
4a1bad429950-41
Return docs most similar to query with an hybrid query. 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.Documen...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
4a1bad429950-42
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
4a1bad429950-43
ttl_seconds (int | None) – Return type None delete_collection()[source] Just an alias for clear (to better align with other VectorStore implementations). Return type None clear()[source] Empty the collection. Return type None delete_by_document_id(document_id)[source] Parameters document_id (str) – Return type Non...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
4a1bad429950-44
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 (int) – Number of Documents to return. Defa...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
4a1bad429950-45
similarity_search_with_score_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 (int) – Number of Documents to return. Defaults to 4. Returns List o...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
4a1bad429950-46
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_with_score(query, k=4, **kwargs)[source] Para...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
4a1bad429950-47
: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 determines the degree of diversity among the results with 0 corresponding to maximum diversity and 1 to minimum diversity. Returns List of Documents selected by...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
4a1bad429950-48
: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 determines the degree of diversity among the results with 0 corresponding to maximum diversity and 1 to minimum diversity. Optional. Returns List of Documents s...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
4a1bad429950-49
metadatas (Optional[List[dict]]) – kwargs (Any) – Return type langchain.vectorstores.cassandra.CVST classmethod from_documents(documents, embedding, **kwargs)[source] Create a Cassandra vectorstore from a document list. No support for specifying text IDs Returns a Cassandra vectorstore. Parameters documents (List[la...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
4a1bad429950-50
Example from langchain.vectorstores import Chroma from langchain.embeddings.openai import OpenAIEmbeddings embeddings = OpenAIEmbeddings() vectorstore = Chroma("langchain_store", embeddings) Parameters collection_name (str) – embedding_function (Optional[Embeddings]) – persist_directory (Optional[str]) – client_sett...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
4a1bad429950-51
ids (Optional[List[str]], optional) – Optional list of IDs. kwargs (Any) – Returns List of IDs of the added texts. Return type List[str] similarity_search(query, k=4, filter=None, **kwargs)[source] Run similarity search with Chroma. Parameters query (str) – Query text to search for. k (int) – Number of results to ret...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
4a1bad429950-52
: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 similar to the query vector. Parameters embedding (List[float]) – k (int) – filter (Optional[Dict[str, st...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
4a1bad429950-53
kwargs (Any) – Returns List of documents most similar to the query text and cosine distance in float for each. Lower score represents more similarity. Return type List[Tuple[Document, float]] max_marginal_relevance_search_by_vector(embedding, k=4, fetch_k=20, lambda_mult=0.5, filter=None, **kwargs)[source] Return doc...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
4a1bad429950-54
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 maximal marginal relevance. Return type List[langchain.schema.Document] ma...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
4a1bad429950-55
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
4a1bad429950-56
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 (Optional[WhereDocument]) – A WhereDocument type dict used to filter b...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
4a1bad429950-57
It will also be called automatically when the object is destroyed. Return type None update_document(document_id, document)[source] Update a document in the collection. Parameters document_id (str) – ID of the document to update. document (Document) – Document to update. Return type None classmethod from_texts(texts, e...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
4a1bad429950-58
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 IDs. Defaults to None. client_settings (Optional[chromadb.config.Settings]) – Chroma client settings client (Optional[chromadb.Cli...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
4a1bad429950-59
persist_directory (Optional[str]) – Directory to persist the collection. ids (Optional[List[str]]) – List of document IDs. Defaults to None. documents (List[Document]) – List of documents to add to the vectorstore. embedding (Optional[Embeddings]) – Embedding function. Defaults to None. client_settings (Optional[chroma...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
4a1bad429950-60
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 sub-queries. For more information, please visit[C...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
4a1bad429950-61
ids (Optional[Iterable[str]]) – Optional list of ids to associate with the texts. batch_size (int) – Batch size of insertion metadata – Optional column data to be inserted metadatas (Optional[List[dict]]) – kwargs (Any) – Returns List of ids from adding the texts into the VectorStore. Return type List[str] classmetho...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
4a1bad429950-62
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
4a1bad429950-63
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 with metadatas, remember to use {self.metadata_column}.attribute instead of attribute alone. The default name for it is metadata. kwargs (Any)...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
4a1bad429950-64
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
4a1bad429950-65
alone. The default name for it is metadata. kwargs (Any) – Returns List of documents Return type List[Document] drop()[source] Helper function: Drop data Return type None property metadata_column: str pydantic settings langchain.vectorstores.ClickhouseSettings[source] Bases: pydantic.env_settings.BaseSettings Click...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
4a1bad429950-66
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’, β€˜manhattan’, β€˜hamming’, β€˜dot’). Defaults to β€˜angula...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
4a1bad429950-67
β€˜metadata’: β€˜metadata_dictionary_in_json’, } Defaults to identity map. Show JSON schema{ "title": "ClickhouseSettings",
https://api.python.langchain.com/en/latest/modules/vectorstores.html
4a1bad429950-68
"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 username (str) : Username to login. Defaults to None.\n ...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
4a1bad429950-69
table (str) : Table name to operate on.\n Defaults to 'vector_table'.\n metric (str) : Metric to compute distance,\n supported are ('angular', 'euclidean', 'manhattan', 'hamming',\n 'dot'). Defaults to 'angular'.\n https://github.com/spotify/anno...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
4a1bad429950-70
semantics. Must have keys: `text`, `id`, `vector`,\n must be same size to number of columns. For example:\n .. code-block:: python\n\n {\n 'id': 'text_id',\n 'uuid':
https://api.python.langchain.com/en/latest/modules/vectorstores.html
4a1bad429950-71
'uuid': 'global_unique_id'\n 'embedding': 'text_embedding',\n 'document': 'text_plain',\n 'metadata': 'metadata_dictionary_in_json',\n }\n\n Defaults to identity map.",
https://api.python.langchain.com/en/latest/modules/vectorstores.html
4a1bad429950-72
"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
4a1bad429950-73
"title": "Index Type", "default": "annoy", "env_names": "{'clickhouse_index_type'}", "type": "string" }, "index_param": { "title": "Index Param", "default": [ "'L2Distance'", 100 ], "env_names": "{'clickhouse_index_param'...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
4a1bad429950-74
"additionalProperties": { "type": "string" } }, "column_map": { "title": "Column Map", "default": { "id": "id", "uuid": "uuid", "document": "document", "embedding": "embedding", "metadata": "metadata" ...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
4a1bad429950-75
"default": "langchain", "env_names": "{'clickhouse_table'}", "type": "string" }, "metric": { "title": "Metric", "default": "angular", "env_names": "{'clickhouse_metric'}", "type": "string" } }, "additionalProperties": false } Config env_file:...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
4a1bad429950-76
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]] = ["'L2Distance'", 100] attr...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
4a1bad429950-77
class langchain.vectorstores.DeepLake(dataset_path='./deeplake/', token=None, embedding_function=None, read_only=False, ingestion_batch_size=1000, num_workers=0, verbose=True, exec_option='python', **kwargs)[source] Bases: langchain.vectorstores.base.VectorStore Wrapper around Deep Lake, a data lake for deep learning ...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
4a1bad429950-78
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
4a1bad429950-79
... texts = <list_of_texts>, ... metadatas = <list_of_metadata_jsons>, ... ids = <list_of_ids>, ... ) 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. **kwa...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
4a1bad429950-80
... ) >>> # 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
4a1bad429950-81
(sample must satisfy all key-value filters) Dict = {β€œtensor_1”: {β€œkey”: value}, β€œtensor_2”: {β€œkey”: value}} Function: Compatible with deeplake.filter. Defaults to None. exec_option (str): Supports 3 ways to perform searching.’python’, β€˜compute_engine’, or β€˜tensor_db’. Defaults to β€˜python’. - β€˜python’: Pure-python imple...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
4a1bad429950-82
Return type List[Document] 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=<pre...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
4a1bad429950-83
”tensor_name_2”: {β€œkey”: value}} Function - Any function compatible withdeeplake.filter. Defaults to None. exec_option (str): Options for search execution include”python”, β€œcompute_engine”, or β€œtensor_db”. Defaults to β€œpython”. - β€œpython” - Pure-python implementation running on the client. Can be used for data stored a...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
4a1bad429950-84
To store datasets in this database, specify 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 ve...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
4a1bad429950-85
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/modules/vectorstores.html
4a1bad429950-86
memory issues. ”compute_engine” - Performant C++ implementation of the DeepLake Compute Engine. Runs on the client and can be used for 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 ...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
4a1bad429950-87
Return docs selected using the maximal marginal relevance. Maximal marginal relevance optimizes for similarity to query AND diversity among selected docs. Examples: >>> data = vector_store.max_marginal_relevance_search_by_vector( … embedding=<your_embedding>, … fetch_k=<elements_to_fetch_before_mmr_search...
https://api.python.langchain.com/en/latest/modules/vectorstores.html
4a1bad429950-88
exec_option (str) – DeepLakeVectorStore supports 3 ways for searching. Could be β€œpython”, β€œcompute_engine” or β€œtensor_db”. Defaults to β€œ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 potenti...
https://api.python.langchain.com/en/latest/modules/vectorstores.html