id stringlengths 14 15 | text stringlengths 13 2.7k | source stringlengths 60 181 |
|---|---|---|
6bac444d6f10-5 | classmethod from_orm(obj: Any) → Model¶
get_input_schema(config: Optional[RunnableConfig] = None) → Type[BaseModel]¶
Get a pydantic model that can be used to validate input to the runnable.
Runnables that leverage the configurable_fields and configurable_alternatives
methods will have a dynamic input schema that depend... | https://api.python.langchain.com/en/latest/retrievers/langchain_community.retrievers.weaviate_hybrid_search.WeaviateHybridSearchRetriever.html |
6bac444d6f10-6 | :param query: string to find relevant documents for
:param callbacks: Callback manager or list of callbacks
:param tags: Optional list of tags associated with the retriever. Defaults to None
These tags will be associated with each call to this retriever,
and passed as arguments to the handlers defined in callbacks.
Par... | https://api.python.langchain.com/en/latest/retrievers/langchain_community.retrievers.weaviate_hybrid_search.WeaviateHybridSearchRetriever.html |
6bac444d6f10-7 | classmethod lc_id() → List[str]¶
A unique identifier for this class for serialization purposes.
The unique identifier is a list of strings that describes the path
to the object.
map() → Runnable[List[Input], List[Output]]¶
Return a new Runnable that maps a list of inputs to a list of outputs,
by calling invoke() with e... | https://api.python.langchain.com/en/latest/retrievers/langchain_community.retrievers.weaviate_hybrid_search.WeaviateHybridSearchRetriever.html |
6bac444d6f10-8 | classmethod update_forward_refs(**localns: Any) → None¶
Try to update ForwardRefs on fields based on this Model, globalns and localns.
classmethod validate(value: Any) → Model¶
with_config(config: Optional[RunnableConfig] = None, **kwargs: Any) → Runnable[Input, Output]¶
Bind config to a Runnable, returning a new Runna... | https://api.python.langchain.com/en/latest/retrievers/langchain_community.retrievers.weaviate_hybrid_search.WeaviateHybridSearchRetriever.html |
6bac444d6f10-9 | added to the run.
with_retry(*, retry_if_exception_type: ~typing.Tuple[~typing.Type[BaseException], ...] = (<class 'Exception'>,), wait_exponential_jitter: bool = True, stop_after_attempt: int = 3) → Runnable[Input, Output]¶
Create a new Runnable that retries the original runnable on exceptions.
Parameters
retry_if_exc... | https://api.python.langchain.com/en/latest/retrievers/langchain_community.retrievers.weaviate_hybrid_search.WeaviateHybridSearchRetriever.html |
6bac444d6f10-10 | property output_schema: Type[pydantic.main.BaseModel]¶
The type of output this runnable produces specified as a pydantic model.
Examples using WeaviateHybridSearchRetriever¶
Weaviate Hybrid Search | https://api.python.langchain.com/en/latest/retrievers/langchain_community.retrievers.weaviate_hybrid_search.WeaviateHybridSearchRetriever.html |
2067563ca8c8-0 | langchain_community.document_transformers.doctran_text_translate.DoctranTextTranslator¶
class langchain_community.document_transformers.doctran_text_translate.DoctranTextTranslator(openai_api_key: Optional[str] = None, language: str = 'english', openai_api_model: Optional[str] = None)[source]¶
Translate text documents ... | https://api.python.langchain.com/en/latest/document_transformers/langchain_community.document_transformers.doctran_text_translate.DoctranTextTranslator.html |
6f60145bf957-0 | langchain_community.document_transformers.google_translate.GoogleTranslateTransformer¶
class langchain_community.document_transformers.google_translate.GoogleTranslateTransformer(project_id: str, *, location: str = 'global', model_id: Optional[str] = None, glossary_id: Optional[str] = None, api_endpoint: Optional[str] ... | https://api.python.langchain.com/en/latest/document_transformers/langchain_community.document_transformers.google_translate.GoogleTranslateTransformer.html |
6f60145bf957-1 | Translate text documents using Google Translate.
Parameters
source_language_code – ISO 639 language code of the input document.
target_language_code – ISO 639 language code of the output document.
For supported languages, refer to:
https://cloud.google.com/translate/docs/languages
mime_type – (Optional) Media Type of i... | https://api.python.langchain.com/en/latest/document_transformers/langchain_community.document_transformers.google_translate.GoogleTranslateTransformer.html |
c339c63cb8ec-0 | langchain_community.document_transformers.html2text.Html2TextTransformer¶
class langchain_community.document_transformers.html2text.Html2TextTransformer(ignore_links: bool = True, ignore_images: bool = True)[source]¶
Replace occurrences of a particular search pattern with a replacement string
Parameters
ignore_links – ... | https://api.python.langchain.com/en/latest/document_transformers/langchain_community.document_transformers.html2text.Html2TextTransformer.html |
2384a82fc137-0 | langchain_community.document_transformers.embeddings_redundant_filter.EmbeddingsRedundantFilter¶
class langchain_community.document_transformers.embeddings_redundant_filter.EmbeddingsRedundantFilter[source]¶
Bases: BaseDocumentTransformer, BaseModel
Filter that drops redundant documents by comparing their embeddings.
C... | https://api.python.langchain.com/en/latest/document_transformers/langchain_community.document_transformers.embeddings_redundant_filter.EmbeddingsRedundantFilter.html |
2384a82fc137-1 | Duplicate a model, optionally choose which fields to include, exclude and change.
Parameters
include – fields to include in new model
exclude – fields to exclude from new model, as with values this takes precedence over include
update – values to change/add in the new model. Note: the data is not validated before creat... | https://api.python.langchain.com/en/latest/document_transformers/langchain_community.document_transformers.embeddings_redundant_filter.EmbeddingsRedundantFilter.html |
2384a82fc137-2 | classmethod parse_file(path: Union[str, Path], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: Protocol = None, allow_pickle: bool = False) → Model¶
classmethod parse_obj(obj: Any) → Model¶
classmethod parse_raw(b: Union[str, bytes], *, content_type: unicode = None, encoding: unicode = 'utf8', proto... | https://api.python.langchain.com/en/latest/document_transformers/langchain_community.document_transformers.embeddings_redundant_filter.EmbeddingsRedundantFilter.html |
07214537bb40-0 | langchain_community.document_transformers.embeddings_redundant_filter.get_stateful_documents¶
langchain_community.document_transformers.embeddings_redundant_filter.get_stateful_documents(documents: Sequence[Document]) → Sequence[_DocumentWithState][source]¶
Convert a list of documents to a list of documents with state.... | https://api.python.langchain.com/en/latest/document_transformers/langchain_community.document_transformers.embeddings_redundant_filter.get_stateful_documents.html |
67b9cc18d672-0 | langchain_community.document_transformers.beautiful_soup_transformer.get_navigable_strings¶
langchain_community.document_transformers.beautiful_soup_transformer.get_navigable_strings(element: Any) → Iterator[str][source]¶ | https://api.python.langchain.com/en/latest/document_transformers/langchain_community.document_transformers.beautiful_soup_transformer.get_navigable_strings.html |
aee537ae13ea-0 | langchain_community.document_transformers.long_context_reorder.LongContextReorder¶
class langchain_community.document_transformers.long_context_reorder.LongContextReorder[source]¶
Bases: BaseDocumentTransformer, BaseModel
Lost in the middle:
Performance degrades when models must access relevant information
in the middl... | https://api.python.langchain.com/en/latest/document_transformers/langchain_community.document_transformers.long_context_reorder.LongContextReorder.html |
aee537ae13ea-1 | deep – set to True to make a deep copy of the model
Returns
new model instance
dict(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, ex... | https://api.python.langchain.com/en/latest/document_transformers/langchain_community.document_transformers.long_context_reorder.LongContextReorder.html |
aee537ae13ea-2 | classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') → DictStrAny¶
classmethod schema_json(*, by_alias: bool = True, ref_template: unicode = '#/definitions/{model}', **dumps_kwargs: Any) → unicode¶
transform_documents(documents: Sequence[Document], **kwargs: Any) → Sequence[Documen... | https://api.python.langchain.com/en/latest/document_transformers/langchain_community.document_transformers.long_context_reorder.LongContextReorder.html |
399a752caee6-0 | langchain_community.document_transformers.openai_functions.create_metadata_tagger¶
langchain_community.document_transformers.openai_functions.create_metadata_tagger(metadata_schema: Union[Dict[str, Any], Type[BaseModel]], llm: BaseLanguageModel, prompt: Optional[ChatPromptTemplate] = None, *, tagging_chain_kwargs: Opti... | https://api.python.langchain.com/en/latest/document_transformers/langchain_community.document_transformers.openai_functions.create_metadata_tagger.html |
399a752caee6-1 | "required": ["movie_title", "critic", "tone"]
}
# Must be an OpenAI model that supports functions
llm = ChatOpenAI(temperature=0, model="gpt-3.5-turbo-0613")
document_transformer = create_metadata_tagger(schema, llm)
original_documents = [
Document(page_content="Review of The Bee Movie
By Roger Ebert
This is the gr... | https://api.python.langchain.com/en/latest/document_transformers/langchain_community.document_transformers.openai_functions.create_metadata_tagger.html |
9e881f51a741-0 | langchain_community.document_transformers.openai_functions.OpenAIMetadataTagger¶
class langchain_community.document_transformers.openai_functions.OpenAIMetadataTagger[source]¶
Bases: BaseDocumentTransformer, BaseModel
Extract metadata tags from document contents using OpenAI functions.
Example:from langchain_community.... | https://api.python.langchain.com/en/latest/document_transformers/langchain_community.document_transformers.openai_functions.OpenAIMetadataTagger.html |
9e881f51a741-1 | Raises ValidationError if the input data cannot be parsed to form a valid model.
param tagging_chain: Any = None¶
The chain used to extract metadata from each document.
async atransform_documents(documents: Sequence[Document], **kwargs: Any) → Sequence[Document][source]¶
Asynchronously transform a list of documents.
Pa... | https://api.python.langchain.com/en/latest/document_transformers/langchain_community.document_transformers.openai_functions.OpenAIMetadataTagger.html |
9e881f51a741-2 | deep – set to True to make a deep copy of the model
Returns
new model instance
dict(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, ex... | https://api.python.langchain.com/en/latest/document_transformers/langchain_community.document_transformers.openai_functions.OpenAIMetadataTagger.html |
9e881f51a741-3 | classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') → DictStrAny¶
classmethod schema_json(*, by_alias: bool = True, ref_template: unicode = '#/definitions/{model}', **dumps_kwargs: Any) → unicode¶
transform_documents(documents: Sequence[Document], **kwargs: Any) → Sequence[Documen... | https://api.python.langchain.com/en/latest/document_transformers/langchain_community.document_transformers.openai_functions.OpenAIMetadataTagger.html |
82435cc08b13-0 | langchain_community.document_transformers.doctran_text_qa.DoctranQATransformer¶
class langchain_community.document_transformers.doctran_text_qa.DoctranQATransformer(openai_api_key: Optional[str] = None, openai_api_model: Optional[str] = None)[source]¶
Extract QA from text documents using doctran.
Parameters
openai_api_... | https://api.python.langchain.com/en/latest/document_transformers/langchain_community.document_transformers.doctran_text_qa.DoctranQATransformer.html |
59367a1b8d7b-0 | langchain_community.document_transformers.beautiful_soup_transformer.BeautifulSoupTransformer¶
class langchain_community.document_transformers.beautiful_soup_transformer.BeautifulSoupTransformer[source]¶
Transform HTML content by extracting specific tags and removing unwanted ones.
Example
from langchain_community.docu... | https://api.python.langchain.com/en/latest/document_transformers/langchain_community.document_transformers.beautiful_soup_transformer.BeautifulSoupTransformer.html |
59367a1b8d7b-1 | static remove_unnecessary_lines(content: str) → str[source]¶
Clean up the content by removing unnecessary lines.
Parameters
content – A string, which may contain unnecessary lines or spaces.
Returns
A cleaned string with unnecessary lines removed.
static remove_unwanted_tags(html_content: str, unwanted_tags: List[str])... | https://api.python.langchain.com/en/latest/document_transformers/langchain_community.document_transformers.beautiful_soup_transformer.BeautifulSoupTransformer.html |
845728b15d14-0 | langchain_community.document_transformers.embeddings_redundant_filter.EmbeddingsClusteringFilter¶
class langchain_community.document_transformers.embeddings_redundant_filter.EmbeddingsClusteringFilter[source]¶
Bases: BaseDocumentTransformer, BaseModel
Perform K-means clustering on document vectors.
Returns an arbitrary... | https://api.python.langchain.com/en/latest/document_transformers/langchain_community.document_transformers.embeddings_redundant_filter.EmbeddingsClusteringFilter.html |
845728b15d14-1 | documents – A sequence of Documents to be transformed.
Returns
A list of transformed Documents.
classmethod construct(_fields_set: Optional[SetStr] = None, **values: Any) → Model¶
Creates a new model setting __dict__ and __fields_set__ from trusted or pre-validated data.
Default values are respected, but no other valid... | https://api.python.langchain.com/en/latest/document_transformers/langchain_community.document_transformers.embeddings_redundant_filter.EmbeddingsClusteringFilter.html |
845728b15d14-2 | classmethod from_orm(obj: Any) → Model¶
json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_n... | https://api.python.langchain.com/en/latest/document_transformers/langchain_community.document_transformers.embeddings_redundant_filter.EmbeddingsClusteringFilter.html |
845728b15d14-3 | classmethod validate(value: Any) → Model¶
Examples using EmbeddingsClusteringFilter¶
LOTR (Merger Retriever) | https://api.python.langchain.com/en/latest/document_transformers/langchain_community.document_transformers.embeddings_redundant_filter.EmbeddingsClusteringFilter.html |
20ee0221b7a7-0 | langchain_community.document_transformers.doctran_text_extract.DoctranPropertyExtractor¶
class langchain_community.document_transformers.doctran_text_extract.DoctranPropertyExtractor(properties: List[dict], openai_api_key: Optional[str] = None, openai_api_model: Optional[str] = None)[source]¶
Extract properties from te... | https://api.python.langchain.com/en/latest/document_transformers/langchain_community.document_transformers.doctran_text_extract.DoctranPropertyExtractor.html |
20ee0221b7a7-1 | Methods
__init__(properties[, openai_api_key, ...])
atransform_documents(documents, **kwargs)
Extracts properties from text documents using doctran.
transform_documents(documents, **kwargs)
Transform a list of documents.
__init__(properties: List[dict], openai_api_key: Optional[str] = None, openai_api_model: Optional[s... | https://api.python.langchain.com/en/latest/document_transformers/langchain_community.document_transformers.doctran_text_extract.DoctranPropertyExtractor.html |
ba7579f225bf-0 | langchain_community.document_transformers.nuclia_text_transform.NucliaTextTransformer¶
class langchain_community.document_transformers.nuclia_text_transform.NucliaTextTransformer(nua: NucliaUnderstandingAPI)[source]¶
The Nuclia Understanding API splits into paragraphs and sentences,
identifies entities, provides a summ... | https://api.python.langchain.com/en/latest/document_transformers/langchain_community.document_transformers.nuclia_text_transform.NucliaTextTransformer.html |
e8e3792bd11d-0 | langchain_community.vectorstores.dingo.Dingo¶
class langchain_community.vectorstores.dingo.Dingo(embedding: Embeddings, text_key: str, *, client: Any = None, index_name: Optional[str] = None, dimension: int = 1024, host: Optional[List[str]] = None, user: str = 'root', password: str = '123123', self_id: bool = False)[so... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.dingo.Dingo.html |
e8e3792bd11d-1 | amax_marginal_relevance_search(query[, k, ...])
Return docs selected using the maximal marginal relevance.
amax_marginal_relevance_search_by_vector(...)
Return docs selected using the maximal marginal relevance.
as_retriever(**kwargs)
Return VectorStoreRetriever initialized from this VectorStore.
asearch(query, search_... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.dingo.Dingo.html |
e8e3792bd11d-2 | Return docs and relevance scores in the range [0, 1].
similarity_search_with_score(query[, k, ...])
Return Dingo documents most similar to query, along with scores.
__init__(embedding: Embeddings, text_key: str, *, client: Any = None, index_name: Optional[str] = None, dimension: int = 1024, host: Optional[List[str]] = ... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.dingo.Dingo.html |
e8e3792bd11d-3 | Parameters
texts – Iterable of strings to add to the vectorstore.
metadatas – Optional list of metadatas associated with the texts.
ids – Optional list of ids to associate with the texts.
Returns
List of ids from adding the texts into the vectorstore.
async adelete(ids: Optional[List[str]] = None, **kwargs: Any) → Opti... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.dingo.Dingo.html |
e8e3792bd11d-4 | Parameters
search_type (Optional[str]) – Defines the type of search that
the Retriever should perform.
Can be “similarity” (default), “mmr”, or
“similarity_score_threshold”.
search_kwargs (Optional[Dict]) – Keyword arguments to pass to the
search function. Can include things like:
k: Amount of documents to return (Defa... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.dingo.Dingo.html |
e8e3792bd11d-5 | docsearch.as_retriever(
search_kwargs={'filter': {'paper_title':'GPT-4 Technical Report'}}
)
async asearch(query: str, search_type: str, **kwargs: Any) → List[Document]¶
Return docs most similar to query using specified search type.
async asimilarity_search(query: str, k: int = 4, **kwargs: Any) → List[Document]¶
R... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.dingo.Dingo.html |
e8e3792bd11d-6 | Return VectorStore initialized from documents and embeddings.
classmethod from_texts(texts: List[str], embedding: Embeddings, metadatas: Optional[List[dict]] = None, ids: Optional[List[str]] = None, text_key: str = 'text', index_name: Optional[str] = None, dimension: int = 1024, client: Any = None, host: List[str] = ['... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.dingo.Dingo.html |
e8e3792bd11d-7 | of diversity among the results with 0 corresponding
to maximum diversity and 1 to minimum diversity.
Defaults to 0.5.
Returns
List of Documents selected by maximal marginal relevance.
max_marginal_relevance_search_by_vector(embedding: List[float], k: int = 4, fetch_k: int = 20, lambda_mult: float = 0.5, search_params: ... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.dingo.Dingo.html |
e8e3792bd11d-8 | Returns
List of Documents most similar to the query and score for each
similarity_search_by_vector(embedding: List[float], k: int = 4, **kwargs: Any) → List[Document]¶
Return docs most similar to embedding vector.
Parameters
embedding – Embedding to look up documents similar to.
k – Number of Documents to return. Defau... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.dingo.Dingo.html |
8603b985de37-0 | langchain_community.vectorstores.redis.filters.check_operator_misuse¶
langchain_community.vectorstores.redis.filters.check_operator_misuse(func: Callable) → Callable[source]¶
Decorator to check for misuse of equality operators. | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.redis.filters.check_operator_misuse.html |
47cfbc02074e-0 | langchain_community.vectorstores.llm_rails.LLMRailsRetriever¶
class langchain_community.vectorstores.llm_rails.LLMRailsRetriever[source]¶
Bases: VectorStoreRetriever
Retriever for LLMRails.
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.llm_rails.LLMRailsRetriever.html |
47cfbc02074e-1 | Default implementation runs ainvoke in parallel using asyncio.gather.
The default implementation of batch works well for IO bound runnables.
Subclasses should override this method if they can batch more efficiently;
e.g., if the underlying runnable uses an API which supports a batch mode.
add_documents(documents: List[... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.llm_rails.LLMRailsRetriever.html |
47cfbc02074e-2 | Subclasses should override this method if they can run asynchronously.
async astream(input: Input, config: Optional[RunnableConfig] = None, **kwargs: Optional[Any]) → AsyncIterator[Output]¶
Default implementation of astream, which calls ainvoke.
Subclasses should override this method if they support streaming output.
a... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.llm_rails.LLMRailsRetriever.html |
47cfbc02074e-3 | exclude_types – Exclude logs with these types.
exclude_tags – Exclude logs with these tags.
async atransform(input: AsyncIterator[Input], config: Optional[RunnableConfig] = None, **kwargs: Optional[Any]) → AsyncIterator[Output]¶
Default implementation of atransform, which buffers input and calls astream.
Subclasses sho... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.llm_rails.LLMRailsRetriever.html |
47cfbc02074e-4 | configurable_fields(**kwargs: Union[ConfigurableField, ConfigurableFieldSingleOption, ConfigurableFieldMultiOption]) → RunnableSerializable[Input, Output]¶
classmethod construct(_fields_set: Optional[SetStr] = None, **values: Any) → Model¶
Creates a new model setting __dict__ and __fields_set__ from trusted or pre-vali... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.llm_rails.LLMRailsRetriever.html |
47cfbc02074e-5 | classmethod from_orm(obj: Any) → Model¶
get_input_schema(config: Optional[RunnableConfig] = None) → Type[BaseModel]¶
Get a pydantic model that can be used to validate input to the runnable.
Runnables that leverage the configurable_fields and configurable_alternatives
methods will have a dynamic input schema that depend... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.llm_rails.LLMRailsRetriever.html |
47cfbc02074e-6 | :param query: string to find relevant documents for
:param callbacks: Callback manager or list of callbacks
:param tags: Optional list of tags associated with the retriever. Defaults to None
These tags will be associated with each call to this retriever,
and passed as arguments to the handlers defined in callbacks.
Par... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.llm_rails.LLMRailsRetriever.html |
47cfbc02074e-7 | classmethod lc_id() → List[str]¶
A unique identifier for this class for serialization purposes.
The unique identifier is a list of strings that describes the path
to the object.
map() → Runnable[List[Input], List[Output]]¶
Return a new Runnable that maps a list of inputs to a list of outputs,
by calling invoke() with e... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.llm_rails.LLMRailsRetriever.html |
47cfbc02074e-8 | classmethod update_forward_refs(**localns: Any) → None¶
Try to update ForwardRefs on fields based on this Model, globalns and localns.
classmethod validate(value: Any) → Model¶
with_config(config: Optional[RunnableConfig] = None, **kwargs: Any) → Runnable[Input, Output]¶
Bind config to a Runnable, returning a new Runna... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.llm_rails.LLMRailsRetriever.html |
47cfbc02074e-9 | added to the run.
with_retry(*, retry_if_exception_type: ~typing.Tuple[~typing.Type[BaseException], ...] = (<class 'Exception'>,), wait_exponential_jitter: bool = True, stop_after_attempt: int = 3) → Runnable[Input, Output]¶
Create a new Runnable that retries the original runnable on exceptions.
Parameters
retry_if_exc... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.llm_rails.LLMRailsRetriever.html |
47cfbc02074e-10 | A map of constructor argument names to secret ids.
For example,{“openai_api_key”: “OPENAI_API_KEY”}
property output_schema: Type[pydantic.main.BaseModel]¶
The type of output this runnable produces specified as a pydantic model. | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.llm_rails.LLMRailsRetriever.html |
79d03f19f96d-0 | langchain_community.vectorstores.typesense.Typesense¶
class langchain_community.vectorstores.typesense.Typesense(typesense_client: Client, embedding: Embeddings, *, typesense_collection_name: Optional[str] = None, text_key: str = 'text')[source]¶
Typesense vector store.
To use, you should have the typesense python pack... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.typesense.Typesense.html |
79d03f19f96d-1 | Run more documents through the embeddings and add to the vectorstore.
add_texts(texts[, metadatas, ids])
Run more texts through the embedding and add to the vectorstore.
adelete([ids])
Delete by vector ID or other criteria.
afrom_documents(documents, embedding, **kwargs)
Return VectorStore initialized from documents an... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.typesense.Typesense.html |
79d03f19f96d-2 | max_marginal_relevance_search(query[, k, ...])
Return docs selected using the maximal marginal relevance.
max_marginal_relevance_search_by_vector(...)
Return docs selected using the maximal marginal relevance.
search(query, search_type, **kwargs)
Return docs most similar to query using specified search type.
similarity... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.typesense.Typesense.html |
79d03f19f96d-3 | Returns
List of IDs of the added texts.
Return type
List[str]
add_texts(texts: Iterable[str], metadatas: Optional[List[dict]] = None, ids: Optional[List[str]] = None, **kwargs: Any) → List[str][source]¶
Run more texts through the embedding and add to the vectorstore.
Parameters
texts – Iterable of strings to add to the... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.typesense.Typesense.html |
79d03f19f96d-4 | Return docs selected using the maximal marginal relevance.
async amax_marginal_relevance_search_by_vector(embedding: List[float], k: int = 4, fetch_k: int = 20, lambda_mult: float = 0.5, **kwargs: Any) → List[Document]¶
Return docs selected using the maximal marginal relevance.
as_retriever(**kwargs: Any) → VectorStore... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.typesense.Typesense.html |
79d03f19f96d-5 | search_kwargs={'k': 5, 'fetch_k': 50}
)
# Only retrieve documents that have a relevance score
# Above a certain threshold
docsearch.as_retriever(
search_type="similarity_score_threshold",
search_kwargs={'score_threshold': 0.8}
)
# Only get the single most similar document from the dataset
docsearch.as_retriever... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.typesense.Typesense.html |
79d03f19f96d-6 | Returns
List of Tuples of (doc, similarity_score)
async asimilarity_search_with_score(*args: Any, **kwargs: Any) → List[Tuple[Document, float]]¶
Run similarity search with distance asynchronously.
delete(ids: Optional[List[str]] = None, **kwargs: Any) → Optional[bool]¶
Delete by vector ID or other criteria.
Parameters
... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.typesense.Typesense.html |
79d03f19f96d-7 | Return VectorStore initialized from documents and embeddings.
classmethod from_texts(texts: List[str], embedding: Embeddings, metadatas: Optional[List[dict]] = None, ids: Optional[List[str]] = None, typesense_client: Optional[Client] = None, typesense_client_params: Optional[dict] = None, typesense_collection_name: Opt... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.typesense.Typesense.html |
79d03f19f96d-8 | k – Number of Documents to return. Defaults to 4.
fetch_k – Number of Documents to fetch to pass to MMR algorithm.
lambda_mult – Number between 0 and 1 that determines the degree
of diversity among the results with 0 corresponding
to maximum diversity and 1 to minimum diversity.
Defaults to 0.5.
Returns
List of Documen... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.typesense.Typesense.html |
79d03f19f96d-9 | query – input text
k – Number of Documents to return. Defaults to 4.
**kwargs – kwargs to be passed to similarity search. Should include:
score_threshold: Optional, a floating point value between 0 to 1 to
filter the resulting set of retrieved docs
Returns
List of Tuples of (doc, similarity_score)
similarity_search_wit... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.typesense.Typesense.html |
4bb48a2b5d3e-0 | langchain_community.vectorstores.tiledb.dependable_tiledb_import¶
langchain_community.vectorstores.tiledb.dependable_tiledb_import() → Any[source]¶
Import tiledb-vector-search if available, otherwise raise error. | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.tiledb.dependable_tiledb_import.html |
991c270730ce-0 | langchain_community.vectorstores.redis.filters.RedisFilterField¶
class langchain_community.vectorstores.redis.filters.RedisFilterField(field: str)[source]¶
Base class for RedisFilterFields.
Attributes
OPERATORS
escaper
Methods
__init__(field)
equals(other)
__init__(field: str)[source]¶
equals(other: RedisFilterField) →... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.redis.filters.RedisFilterField.html |
53bc48b388c5-0 | langchain_community.vectorstores.faiss.dependable_faiss_import¶
langchain_community.vectorstores.faiss.dependable_faiss_import(no_avx2: Optional[bool] = None) → Any[source]¶
Import faiss if available, otherwise raise error.
If FAISS_NO_AVX2 environment variable is set, it will be considered
to load FAISS with no AVX2 o... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.faiss.dependable_faiss_import.html |
0d00d6263f50-0 | langchain_community.vectorstores.tiledb.get_documents_array_uri¶
langchain_community.vectorstores.tiledb.get_documents_array_uri(uri: str) → str[source]¶ | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.tiledb.get_documents_array_uri.html |
4da01a5cf7e9-0 | langchain_community.vectorstores.sklearn.JsonSerializer¶
class langchain_community.vectorstores.sklearn.JsonSerializer(persist_path: str)[source]¶
Serializes data in json using the json package from python standard library.
Methods
__init__(persist_path)
extension()
The file extension suggested by this serializer (with... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.sklearn.JsonSerializer.html |
cafcf595a0ce-0 | langchain_community.vectorstores.pgvector.BaseModel¶
class langchain_community.vectorstores.pgvector.BaseModel(**kwargs: Any)[source]¶
Base model for the SQL stores.
A simple constructor that allows initialization from kwargs.
Sets attributes on the constructed instance using the names and
values in kwargs.
Only keys t... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.pgvector.BaseModel.html |
4e4c0ac63984-0 | langchain_community.vectorstores.pgembedding.BaseModel¶
class langchain_community.vectorstores.pgembedding.BaseModel(**kwargs: Any)[source]¶
Base model for all SQL stores.
A simple constructor that allows initialization from kwargs.
Sets attributes on the constructed instance using the names and
values in kwargs.
Only ... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.pgembedding.BaseModel.html |
87d3993e1e58-0 | langchain_community.vectorstores.utils.DistanceStrategy¶
class langchain_community.vectorstores.utils.DistanceStrategy(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Enumerator of the Distance strategies for calculating distances
between vectors.
EUCLIDEAN_DISTANCE = 'EUCL... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.utils.DistanceStrategy.html |
852ea55c1e7c-0 | langchain_community.vectorstores.scann.dependable_scann_import¶
langchain_community.vectorstores.scann.dependable_scann_import() → Any[source]¶
Import scann if available, otherwise raise error. | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.scann.dependable_scann_import.html |
6f185c051f28-0 | langchain_community.vectorstores.redis.filters.RedisNum¶
class langchain_community.vectorstores.redis.filters.RedisNum(field: str)[source]¶
A RedisFilterField representing a numeric field in a Redis index.
Attributes
OPERATORS
OPERATOR_MAP
SUPPORTED_VAL_TYPES
escaper
Methods
__init__(field)
equals(other)
__init__(field... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.redis.filters.RedisNum.html |
8455d95714b7-0 | langchain_community.vectorstores.pgembedding.QueryResult¶
class langchain_community.vectorstores.pgembedding.QueryResult[source]¶
Result from a query.
Attributes
EmbeddingStore
distance
Methods
__init__()
__init__()¶ | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.pgembedding.QueryResult.html |
ebee75dae2cc-0 | langchain_community.vectorstores.momento_vector_index.MomentoVectorIndex¶
class langchain_community.vectorstores.momento_vector_index.MomentoVectorIndex(embedding: Embeddings, client: PreviewVectorIndexClient, index_name: str = 'default', distance_strategy: DistanceStrategy = DistanceStrategy.COSINE, text_field: str = ... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.momento_vector_index.MomentoVectorIndex.html |
ebee75dae2cc-1 | the squared Euclidean distance. Defaults to DistanceStrategy.COSINE.
text_field (str, optional) – The name of the metadata field to store the
original text in. Defaults to “text”.
ensure_index_exists (bool, optional) – Whether to ensure that the index
exists before adding documents to it. Defaults to True.
Attributes
e... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.momento_vector_index.MomentoVectorIndex.html |
ebee75dae2cc-2 | asimilarity_search(query[, k])
Return docs most similar to query.
asimilarity_search_by_vector(embedding[, k])
Return docs most similar to embedding vector.
asimilarity_search_with_relevance_scores(query)
Return docs and relevance scores in the range [0, 1], asynchronously.
asimilarity_search_with_score(*args, **kwargs... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.momento_vector_index.MomentoVectorIndex.html |
ebee75dae2cc-3 | Initialize a Vector Store backed by Momento Vector Index.
Parameters
embedding (Embeddings) – The embedding function to use.
configuration (VectorIndexConfiguration) – The configuration to initialize
the Vector Index with.
credential_provider (CredentialProvider) – The credential provider to
authenticate the Vector Ind... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.momento_vector_index.MomentoVectorIndex.html |
ebee75dae2cc-4 | Returns
List of IDs of the added texts.
Return type
List[str]
add_texts(texts: Iterable[str], metadatas: Optional[List[dict]] = None, **kwargs: Any) → List[str][source]¶
Run more texts through the embeddings and add to the vectorstore.
Parameters
texts (Iterable[str]) – Iterable of strings to add to the vectorstore.
me... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.momento_vector_index.MomentoVectorIndex.html |
ebee75dae2cc-5 | Return docs selected using the maximal marginal relevance.
async amax_marginal_relevance_search_by_vector(embedding: List[float], k: int = 4, fetch_k: int = 20, lambda_mult: float = 0.5, **kwargs: Any) → List[Document]¶
Return docs selected using the maximal marginal relevance.
as_retriever(**kwargs: Any) → VectorStore... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.momento_vector_index.MomentoVectorIndex.html |
ebee75dae2cc-6 | search_kwargs={'k': 5, 'fetch_k': 50}
)
# Only retrieve documents that have a relevance score
# Above a certain threshold
docsearch.as_retriever(
search_type="similarity_score_threshold",
search_kwargs={'score_threshold': 0.8}
)
# Only get the single most similar document from the dataset
docsearch.as_retriever... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.momento_vector_index.MomentoVectorIndex.html |
ebee75dae2cc-7 | Returns
List of Tuples of (doc, similarity_score)
async asimilarity_search_with_score(*args: Any, **kwargs: Any) → List[Tuple[Document, float]]¶
Run similarity search with distance asynchronously.
delete(ids: Optional[List[str]] = None, **kwargs: Any) → Optional[bool][source]¶
Delete by vector ID.
Parameters
ids (List[... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.momento_vector_index.MomentoVectorIndex.html |
ebee75dae2cc-8 | use. Defaults to DistanceStrategy.COSINE. If you select
DistanceStrategy.EUCLIDEAN_DISTANCE, Momento uses the squared
Euclidean distance.
ensure_index_exists (-) – Whether to ensure that the index
exists before adding documents to it. Defaults to True.
key (Additionally you can either pass in a client or an API) –
cli... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.momento_vector_index.MomentoVectorIndex.html |
ebee75dae2cc-9 | Return docs selected using the maximal marginal relevance.
Maximal marginal relevance optimizes for similarity to query AND diversity
among selected documents.
Parameters
embedding – Embedding to look up documents similar to.
k – Number of Documents to return. Defaults to 4.
fetch_k – Number of Documents to fetch to pa... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.momento_vector_index.MomentoVectorIndex.html |
ebee75dae2cc-10 | Return docs and relevance scores in the range [0, 1].
0 is dissimilar, 1 is most similar.
Parameters
query – input text
k – Number of Documents to return. Defaults to 4.
**kwargs – kwargs to be passed to similarity search. Should include:
score_threshold: Optional, a floating point value between 0 to 1 to
filter the re... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.momento_vector_index.MomentoVectorIndex.html |
fd4748be6012-0 | langchain_community.vectorstores.vearch.Vearch¶
class langchain_community.vectorstores.vearch.Vearch(embedding_function: Embeddings, path_or_url: Optional[str] = None, table_name: str = 'langchain_vearch', db_name: str = 'cluster_client_db', flag: int = 1, **kwargs: Any)[source]¶
Initialize vearch vector store
flag 1 f... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.vearch.Vearch.html |
fd4748be6012-1 | Return docs most similar to query using specified search type.
asimilarity_search(query[, k])
Return docs most similar to query.
asimilarity_search_by_vector(embedding[, k])
Return docs most similar to embedding vector.
asimilarity_search_with_relevance_scores(query)
Return docs and relevance scores in the range [0, 1]... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.vearch.Vearch.html |
fd4748be6012-2 | The most k similar documents and scores of the specified query.
__init__(embedding_function: Embeddings, path_or_url: Optional[str] = None, table_name: str = 'langchain_vearch', db_name: str = 'cluster_client_db', flag: int = 1, **kwargs: Any) → None[source]¶
Initialize vearch vector store
flag 1 for cluster,0 for stan... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.vearch.Vearch.html |
fd4748be6012-3 | Returns
True if deletion is successful,
False otherwise, None if not implemented.
Return type
Optional[bool]
async classmethod afrom_documents(documents: List[Document], embedding: Embeddings, **kwargs: Any) → VST¶
Return VectorStore initialized from documents and embeddings.
async classmethod afrom_texts(texts: List[s... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.vearch.Vearch.html |
fd4748be6012-4 | lambda_mult: Diversity of results returned by MMR;
1 for minimum diversity and 0 for maximum. (Default: 0.5)
filter: Filter by document metadata
Returns
Retriever class for VectorStore.
Return type
VectorStoreRetriever
Examples:
# Retrieve more documents with higher diversity
# Useful if your dataset has many similar d... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.vearch.Vearch.html |
fd4748be6012-5 | Return docs most similar to embedding vector.
async asimilarity_search_with_relevance_scores(query: str, k: int = 4, **kwargs: Any) → List[Tuple[Document, float]]¶
Return docs and relevance scores in the range [0, 1], asynchronously.
0 is dissimilar, 1 is most similar.
Parameters
query – input text
k – Number of Docume... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.vearch.Vearch.html |
fd4748be6012-6 | Return Vearch VectorStore
classmethod from_texts(texts: List[str], embedding: Embeddings, metadatas: Optional[List[dict]] = None, path_or_url: Optional[str] = None, table_name: str = 'langchain_vearch', db_name: str = 'cluster_client_db', flag: int = 1, **kwargs: Any) → Vearch[source]¶
Return Vearch VectorStore
get(ids... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.vearch.Vearch.html |
fd4748be6012-7 | Defaults to 0.5.
Returns
List of Documents selected by maximal marginal relevance.
max_marginal_relevance_search_by_vector(embedding: List[float], k: int = 4, fetch_k: int = 20, lambda_mult: float = 0.5, **kwargs: Any) → List[Document]¶
Return docs selected using the maximal marginal relevance.
Maximal marginal relevan... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.vearch.Vearch.html |
fd4748be6012-8 | 0 is dissimilar, 1 is the most similar.
similarity_search_with_relevance_scores(query: str, k: int = 4, **kwargs: Any) → List[Tuple[Document, float]]¶
Return docs and relevance scores in the range [0, 1].
0 is dissimilar, 1 is most similar.
Parameters
query – input text
k – Number of Documents to return. Defaults to 4.... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.vearch.Vearch.html |
a3ac115b12db-0 | langchain_community.vectorstores.redis.schema.TagFieldSchema¶
class langchain_community.vectorstores.redis.schema.TagFieldSchema[source]¶
Bases: RedisField
Schema for tag fields in Redis.
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be p... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.redis.schema.TagFieldSchema.html |
a3ac115b12db-1 | deep – set to True to make a deep copy of the model
Returns
new model instance
dict(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclude_unset: bool = False, ex... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.redis.schema.TagFieldSchema.html |
a3ac115b12db-2 | classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') → DictStrAny¶
classmethod schema_json(*, by_alias: bool = True, ref_template: unicode = '#/definitions/{model}', **dumps_kwargs: Any) → unicode¶
classmethod update_forward_refs(**localns: Any) → None¶
Try to update ForwardRefs on... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.redis.schema.TagFieldSchema.html |
f06f4a082e8a-0 | langchain_community.vectorstores.dashvector.DashVector¶
class langchain_community.vectorstores.dashvector.DashVector(collection: Any, embedding: Embeddings, text_field: str)[source]¶
DashVector vector store.
To use, you should have the dashvector python package installed.
Example
from langchain_community.vectorstores i... | https://api.python.langchain.com/en/latest/vectorstores/langchain_community.vectorstores.dashvector.DashVector.html |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.