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