id
stringlengths
14
16
text
stringlengths
13
2.7k
source
stringlengths
57
178
2c45ea1ac427-8
Bind config to a Runnable, returning a new Runnable. with_fallbacks(fallbacks: Sequence[Runnable[Input, Output]], *, exceptions_to_handle: Tuple[Type[BaseException], ...] = (<class 'Exception'>,)) → RunnableWithFallbacksT[Input, Output]¶ Add fallbacks to a runnable, returning a new Runnable. Parameters fallbacks – A se...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.zilliz.ZillizRetriever.html
2c45ea1ac427-9
between retries stop_after_attempt – The maximum number of attempts to make before giving up Returns A new Runnable that retries the original runnable on exceptions. with_types(*, input_type: Optional[Type[Input]] = None, output_type: Optional[Type[Output]] = None) → Runnable[Input, Output]¶ Bind input and output types...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.zilliz.ZillizRetriever.html
3133ddf507d0-0
langchain.retrievers.document_compressors.base.DocumentCompressorPipeline¶ class langchain.retrievers.document_compressors.base.DocumentCompressorPipeline[source]¶ Bases: BaseDocumentCompressor Document compressor that uses a pipeline of Transformers. Create a new model by parsing and validating input data from keyword...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.document_compressors.base.DocumentCompressorPipeline.html
3133ddf507d0-1
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 creating the new model: you should trust this data deep – set to True to make a deep co...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.document_compressors.base.DocumentCompressorPipeline.html
3133ddf507d0-2
classmethod parse_obj(obj: Any) → Model¶ classmethod parse_raw(b: Union[str, bytes], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: Protocol = None, allow_pickle: bool = False) → Model¶ classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') → DictStrAny¶ classmet...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.document_compressors.base.DocumentCompressorPipeline.html
e68764b96e12-0
langchain.retrievers.tfidf.TFIDFRetriever¶ class langchain.retrievers.tfidf.TFIDFRetriever[source]¶ Bases: BaseRetriever TF-IDF retriever. Largely based on https://github.com/asvskartheek/Text-Retrieval/blob/master/TF-IDF%20Search%20Engine%20(SKLEARN).ipynb Create a new model by parsing and validating input data from k...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.tfidf.TFIDFRetriever.html
e68764b96e12-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. async aget_relevant_documents(...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.tfidf.TFIDFRetriever.html
e68764b96e12-2
Subclasses should override this method if they support streaming output. async astream_log(input: Any, config: Optional[RunnableConfig] = None, *, diff: bool = True, include_names: Optional[Sequence[str]] = None, include_types: Optional[Sequence[str]] = None, include_tags: Optional[Sequence[str]] = None, exclude_names:...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.tfidf.TFIDFRetriever.html
e68764b96e12-3
e.g., if the underlying runnable uses an API which supports a batch mode. bind(**kwargs: Any) → Runnable[Input, Output]¶ Bind arguments to a Runnable, returning a new Runnable. config_schema(*, include: Optional[Sequence[str]] = None) → Type[BaseModel]¶ The type of config this runnable accepts specified as a pydantic m...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.tfidf.TFIDFRetriever.html
e68764b96e12-4
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 creating the new model: you should trust this data deep – set to True to make a deep copy of the model Returns new model instance dict(*, i...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.tfidf.TFIDFRetriever.html
e68764b96e12-5
Returns A pydantic model that can be used to validate input. classmethod get_lc_namespace() → List[str]¶ Get the namespace of the langchain object. For example, if the class is langchain.llms.openai.OpenAI, then the namespace is [“langchain”, “llms”, “openai”] get_output_schema(config: Optional[RunnableConfig] = None) ...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.tfidf.TFIDFRetriever.html
e68764b96e12-6
Transform a single input into an output. Override to implement. Parameters input – The input to the runnable. config – A config to use when invoking the runnable. The config supports standard keys like ‘tags’, ‘metadata’ for tracing purposes, ‘max_concurrency’ for controlling how much work to do in parallel, and other ...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.tfidf.TFIDFRetriever.html
e68764b96e12-7
by calling invoke() with each input. 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 = No...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.tfidf.TFIDFRetriever.html
e68764b96e12-8
classmethod validate(value: Any) → Model¶ with_config(config: Optional[RunnableConfig] = None, **kwargs: Any) → Runnable[Input, Output]¶ Bind config to a Runnable, returning a new Runnable. with_fallbacks(fallbacks: Sequence[Runnable[Input, Output]], *, exceptions_to_handle: Tuple[Type[BaseException], ...] = (<class 'E...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.tfidf.TFIDFRetriever.html
e68764b96e12-9
Create a new Runnable that retries the original runnable on exceptions. Parameters retry_if_exception_type – A tuple of exception types to retry on wait_exponential_jitter – Whether to add jitter to the wait time between retries stop_after_attempt – The maximum number of attempts to make before giving up Returns A new ...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.tfidf.TFIDFRetriever.html
d83dced3f450-0
langchain.retrievers.self_query.elasticsearch.ElasticsearchTranslator¶ class langchain.retrievers.self_query.elasticsearch.ElasticsearchTranslator[source]¶ Translate Elasticsearch internal query language elements to valid filters. Attributes allowed_comparators Subset of allowed logical comparators. allowed_operators S...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.self_query.elasticsearch.ElasticsearchTranslator.html
a57bd2643950-0
langchain.retrievers.azure_cognitive_search.AzureCognitiveSearchRetriever¶ class langchain.retrievers.azure_cognitive_search.AzureCognitiveSearchRetriever[source]¶ Bases: BaseRetriever Azure Cognitive Search service retriever. Create a new model by parsing and validating input data from keyword arguments. Raises Valida...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.azure_cognitive_search.AzureCognitiveSearchRetriever.html
a57bd2643950-1
Number of results to retrieve. Set to None to retrieve all results. async abatch(inputs: List[Input], config: Optional[Union[RunnableConfig, List[RunnableConfig]]] = None, *, return_exceptions: bool = False, **kwargs: Optional[Any]) → List[Output]¶ Default implementation runs ainvoke in parallel using asyncio.gather. T...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.azure_cognitive_search.AzureCognitiveSearchRetriever.html
a57bd2643950-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...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.azure_cognitive_search.AzureCognitiveSearchRetriever.html
a57bd2643950-3
Default implementation runs invoke in parallel using a thread pool executor. 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. bind(**kwargs: Any) → R...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.azure_cognitive_search.AzureCognitiveSearchRetriever.html
a57bd2643950-4
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...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.azure_cognitive_search.AzureCognitiveSearchRetriever.html
a57bd2643950-5
namespace is [“langchain”, “llms”, “openai”] get_output_schema(config: Optional[RunnableConfig] = None) → Type[BaseModel]¶ Get a pydantic model that can be used to validate output to the runnable. Runnables that leverage the configurable_fields and configurable_alternatives methods will have a dynamic output schema tha...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.azure_cognitive_search.AzureCognitiveSearchRetriever.html
a57bd2643950-6
purposes, ‘max_concurrency’ for controlling how much work to do in parallel, and other keys. Please refer to the RunnableConfig for more details. Returns The output of the runnable. classmethod is_lc_serializable() → bool¶ Is this class serializable? json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]]...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.azure_cognitive_search.AzureCognitiveSearchRetriever.html
a57bd2643950-7
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¶ stream(input: Input, config: Optional[RunnableConfig] = None, **kwargs: Optional[Any...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.azure_cognitive_search.AzureCognitiveSearchRetriever.html
a57bd2643950-8
Returns A new Runnable that will try the original runnable, and then each fallback in order, upon failures. with_listeners(*, on_start: Optional[Listener] = None, on_end: Optional[Listener] = None, on_error: Optional[Listener] = None) → Runnable[Input, Output]¶ Bind lifecycle listeners to a Runnable, returning a new Ru...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.azure_cognitive_search.AzureCognitiveSearchRetriever.html
a57bd2643950-9
The type of input this runnable accepts specified as a type annotation. property OutputType: Type[langchain.schema.runnable.utils.Output]¶ The type of output this runnable produces specified as a type annotation. property config_specs: List[langchain.schema.runnable.utils.ConfigurableFieldSpec]¶ List configurable field...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.azure_cognitive_search.AzureCognitiveSearchRetriever.html
c01961fc35fc-0
langchain.retrievers.self_query.deeplake.DeepLakeTranslator¶ class langchain.retrievers.self_query.deeplake.DeepLakeTranslator[source]¶ Translate DeepLake internal query language elements to valid filters. Attributes allowed_comparators Subset of allowed logical comparators. allowed_operators Subset of allowed logical ...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.self_query.deeplake.DeepLakeTranslator.html
b3d248459c80-0
langchain.retrievers.merger_retriever.MergerRetriever¶ class langchain.retrievers.merger_retriever.MergerRetriever[source]¶ Bases: BaseRetriever Retriever that merges the results of multiple retrievers. Create a new model by parsing and validating input data from keyword arguments. Raises ValidationError if the input d...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.merger_retriever.MergerRetriever.html
b3d248459c80-1
e.g., if the underlying runnable uses an API which supports a batch mode. async aget_relevant_documents(query: str, *, callbacks: Callbacks = None, tags: Optional[List[str]] = None, metadata: Optional[Dict[str, Any]] = None, run_name: Optional[str] = None, **kwargs: Any) → List[Document]¶ Asynchronously get documents r...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.merger_retriever.MergerRetriever.html
b3d248459c80-2
Subclasses should override this method if they support streaming output. async astream_log(input: Any, config: Optional[RunnableConfig] = None, *, diff: bool = True, include_names: Optional[Sequence[str]] = None, include_types: Optional[Sequence[str]] = None, include_tags: Optional[Sequence[str]] = None, exclude_names:...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.merger_retriever.MergerRetriever.html
b3d248459c80-3
e.g., if the underlying runnable uses an API which supports a batch mode. bind(**kwargs: Any) → Runnable[Input, Output]¶ Bind arguments to a Runnable, returning a new Runnable. config_schema(*, include: Optional[Sequence[str]] = None) → Type[BaseModel]¶ The type of config this runnable accepts specified as a pydantic m...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.merger_retriever.MergerRetriever.html
b3d248459c80-4
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 creating the new model: you should trust this data deep – set to True to make a deep copy of the model Returns new model instance dict(*, i...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.merger_retriever.MergerRetriever.html
b3d248459c80-5
Get a pydantic model that can be used to validate output to the runnable. Runnables that leverage the configurable_fields and configurable_alternatives methods will have a dynamic output schema that depends on which configuration the runnable is invoked with. This method allows to get an output schema for a specific co...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.merger_retriever.MergerRetriever.html
b3d248459c80-6
Returns The output of the runnable. classmethod is_lc_serializable() → bool¶ Is this class serializable? json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclu...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.merger_retriever.MergerRetriever.html
b3d248459c80-7
classmethod parse_obj(obj: Any) → Model¶ classmethod parse_raw(b: Union[str, bytes], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: Protocol = None, allow_pickle: bool = False) → Model¶ classmethod schema(by_alias: bool = True, ref_template: unicode = '#/definitions/{model}') → DictStrAny¶ classmet...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.merger_retriever.MergerRetriever.html
b3d248459c80-8
Add fallbacks to a runnable, returning a new Runnable. Parameters fallbacks – A sequence of runnables to try if the original runnable fails. exceptions_to_handle – A tuple of exception types to handle. Returns A new Runnable that will try the original runnable, and then each fallback in order, upon failures. with_liste...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.merger_retriever.MergerRetriever.html
b3d248459c80-9
Bind input and output types to a Runnable, returning a new Runnable. property InputType: Type[langchain.schema.runnable.utils.Input]¶ The type of input this runnable accepts specified as a type annotation. property OutputType: Type[langchain.schema.runnable.utils.Output]¶ The type of output this runnable produces speci...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.merger_retriever.MergerRetriever.html
36611150c0d6-0
langchain.retrievers.web_research.WebResearchRetriever¶ class langchain.retrievers.web_research.WebResearchRetriever[source]¶ Bases: BaseRetriever Google Search API retriever. Create a new model by parsing and validating input data from keyword arguments. Raises ValidationError if the input data cannot be parsed to for...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.web_research.WebResearchRetriever.html
36611150c0d6-1
Vector store for storing web pages async abatch(inputs: List[Input], config: Optional[Union[RunnableConfig, List[RunnableConfig]]] = None, *, return_exceptions: bool = False, **kwargs: Optional[Any]) → List[Output]¶ Default implementation runs ainvoke in parallel using asyncio.gather. The default implementation of batc...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.web_research.WebResearchRetriever.html
36611150c0d6-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...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.web_research.WebResearchRetriever.html
36611150c0d6-3
Default implementation runs invoke in parallel using a thread pool executor. 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. bind(**kwargs: Any) → R...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.web_research.WebResearchRetriever.html
36611150c0d6-4
Behaves as if Config.extra = ‘allow’ was set since it adds all passed values copy(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, update: Optional[DictStrAny] = None, deep: bool = False) → Model¶ Duplicate a model, optionally...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.web_research.WebResearchRetriever.html
36611150c0d6-5
Initialize from llm using default template. Parameters vectorstore – Vector store for storing web pages llm – llm for search question generation search – GoogleSearchAPIWrapper prompt – prompt to generating search questions num_search_results – Number of pages per Google search text_splitter – Text splitter for splitti...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.web_research.WebResearchRetriever.html
36611150c0d6-6
Returns A pydantic model that can be used to validate output. get_relevant_documents(query: str, *, callbacks: Callbacks = None, tags: Optional[List[str]] = None, metadata: Optional[Dict[str, Any]] = None, run_name: Optional[str] = None, **kwargs: Any) → List[Document]¶ Retrieve documents relevant to a query. :param qu...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.web_research.WebResearchRetriever.html
36611150c0d6-7
classmethod is_lc_serializable() → bool¶ Is this class serializable? 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_defa...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.web_research.WebResearchRetriever.html
36611150c0d6-8
classmethod schema_json(*, by_alias: bool = True, ref_template: unicode = '#/definitions/{model}', **dumps_kwargs: Any) → unicode¶ search_tool(query: str, num_search_results: int = 1) → List[dict][source]¶ Returns num_search_results pages per Google search. stream(input: Input, config: Optional[RunnableConfig] = None, ...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.web_research.WebResearchRetriever.html
36611150c0d6-9
exceptions_to_handle – A tuple of exception types to handle. Returns A new Runnable that will try the original runnable, and then each fallback in order, upon failures. with_listeners(*, on_start: Optional[Listener] = None, on_end: Optional[Listener] = None, on_error: Optional[Listener] = None) → Runnable[Input, Output...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.web_research.WebResearchRetriever.html
36611150c0d6-10
The type of input this runnable accepts specified as a type annotation. property OutputType: Type[langchain.schema.runnable.utils.Output]¶ The type of output this runnable produces specified as a type annotation. property config_specs: List[langchain.schema.runnable.utils.ConfigurableFieldSpec]¶ List configurable field...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.web_research.WebResearchRetriever.html
0d5b99a9f7d6-0
langchain.retrievers.pinecone_hybrid_search.create_index¶ langchain.retrievers.pinecone_hybrid_search.create_index(contexts: List[str], index: Any, embeddings: Embeddings, sparse_encoder: Any, ids: Optional[List[str]] = None, metadatas: Optional[List[dict]] = None, namespace: Optional[str] = None) → None[source]¶ Creat...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.pinecone_hybrid_search.create_index.html
9532d0f2149b-0
langchain.retrievers.kendra.QueryResultItem¶ class langchain.retrievers.kendra.QueryResultItem[source]¶ Bases: ResultItem Query API result item. Create a new model by parsing and validating input data from keyword arguments. Raises ValidationError if the input data cannot be parsed to form a valid model. param Addition...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.kendra.QueryResultItem.html
9532d0f2149b-1
Default values are respected, but no other validation is performed. Behaves as if Config.extra = ‘allow’ was set since it adds all passed values copy(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, update: Optional[DictStrAny...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.kendra.QueryResultItem.html
9532d0f2149b-2
Document attributes dict. get_excerpt() → str[source]¶ Document excerpt or passage original content as retrieved by Kendra. get_title() → str[source]¶ Document title. json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_al...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.kendra.QueryResultItem.html
9532d0f2149b-3
Converts this item to a Document. 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¶
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.kendra.QueryResultItem.html
b156ec512879-0
langchain.retrievers.multi_vector.MultiVectorRetriever¶ class langchain.retrievers.multi_vector.MultiVectorRetriever[source]¶ Bases: BaseRetriever Retrieve from a set of multiple embeddings for the same document. Create a new model by parsing and validating input data from keyword arguments. Raises ValidationError if t...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.multi_vector.MultiVectorRetriever.html
b156ec512879-1
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. async aget_relevant_documents(query: str, *, callbacks: Callbacks = None, tags: Optional[List[str]] ...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.multi_vector.MultiVectorRetriever.html
b156ec512879-2
Subclasses should override this method if they support streaming output. async astream_log(input: Any, config: Optional[RunnableConfig] = None, *, diff: bool = True, include_names: Optional[Sequence[str]] = None, include_types: Optional[Sequence[str]] = None, include_tags: Optional[Sequence[str]] = None, exclude_names:...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.multi_vector.MultiVectorRetriever.html
b156ec512879-3
e.g., if the underlying runnable uses an API which supports a batch mode. bind(**kwargs: Any) → Runnable[Input, Output]¶ Bind arguments to a Runnable, returning a new Runnable. config_schema(*, include: Optional[Sequence[str]] = None) → Type[BaseModel]¶ The type of config this runnable accepts specified as a pydantic m...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.multi_vector.MultiVectorRetriever.html
b156ec512879-4
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 creating the new model: you should trust this data deep – set to True to make a deep copy of the model Returns new model instance dict(*, i...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.multi_vector.MultiVectorRetriever.html
b156ec512879-5
Get a pydantic model that can be used to validate output to the runnable. Runnables that leverage the configurable_fields and configurable_alternatives methods will have a dynamic output schema that depends on which configuration the runnable is invoked with. This method allows to get an output schema for a specific co...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.multi_vector.MultiVectorRetriever.html
b156ec512879-6
Returns The output of the runnable. classmethod is_lc_serializable() → bool¶ Is this class serializable? json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[bool] = None, exclu...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.multi_vector.MultiVectorRetriever.html
b156ec512879-7
classmethod schema_json(*, by_alias: bool = True, ref_template: unicode = '#/definitions/{model}', **dumps_kwargs: Any) → unicode¶ stream(input: Input, config: Optional[RunnableConfig] = None, **kwargs: Optional[Any]) → Iterator[Output]¶ Default implementation of stream, which calls invoke. Subclasses should override t...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.multi_vector.MultiVectorRetriever.html
b156ec512879-8
fallback in order, upon failures. with_listeners(*, on_start: Optional[Listener] = None, on_end: Optional[Listener] = None, on_error: Optional[Listener] = None) → Runnable[Input, Output]¶ Bind lifecycle listeners to a Runnable, returning a new Runnable. on_start: Called before the runnable starts running, with the Run ...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.multi_vector.MultiVectorRetriever.html
b156ec512879-9
The type of output this runnable produces specified as a type annotation. property config_specs: List[langchain.schema.runnable.utils.ConfigurableFieldSpec]¶ List configurable fields for this runnable. property input_schema: Type[pydantic.main.BaseModel]¶ The type of input this runnable accepts specified as a pydantic ...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.multi_vector.MultiVectorRetriever.html
5872106cd19c-0
langchain.retrievers.ensemble.EnsembleRetriever¶ class langchain.retrievers.ensemble.EnsembleRetriever[source]¶ Bases: BaseRetriever Retriever that ensembles the multiple retrievers. It uses a rank fusion. Parameters retrievers – A list of retrievers to ensemble. weights – A list of weights corresponding to the retriev...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.ensemble.EnsembleRetriever.html
5872106cd19c-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. async aget_relevant_documents(...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.ensemble.EnsembleRetriever.html
5872106cd19c-2
query – The query to search for. Returns A list of reranked documents. 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...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.ensemble.EnsembleRetriever.html
5872106cd19c-3
Default implementation runs invoke in parallel using a thread pool executor. 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. bind(**kwargs: Any) → R...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.ensemble.EnsembleRetriever.html
5872106cd19c-4
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...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.ensemble.EnsembleRetriever.html
5872106cd19c-5
namespace is [“langchain”, “llms”, “openai”] get_output_schema(config: Optional[RunnableConfig] = None) → Type[BaseModel]¶ Get a pydantic model that can be used to validate output to the runnable. Runnables that leverage the configurable_fields and configurable_alternatives methods will have a dynamic output schema tha...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.ensemble.EnsembleRetriever.html
5872106cd19c-6
purposes, ‘max_concurrency’ for controlling how much work to do in parallel, and other keys. Please refer to the RunnableConfig for more details. Returns The output of the runnable. classmethod is_lc_serializable() → bool¶ Is this class serializable? json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]]...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.ensemble.EnsembleRetriever.html
5872106cd19c-7
rank_fusion(query: str, run_manager: CallbackManagerForRetrieverRun) → List[Document][source]¶ Retrieve the results of the retrievers and use rank_fusion_func to get the final result. Parameters query – The query to search for. Returns A list of reranked documents. classmethod schema(by_alias: bool = True, ref_template...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.ensemble.EnsembleRetriever.html
5872106cd19c-8
Parameters doc_lists – A list of rank lists, where each rank list contains unique items. Returns The final aggregated list of items sorted by their weighted RRFscores in descending order. Return type list with_config(config: Optional[RunnableConfig] = None, **kwargs: Any) → Runnable[Input, Output]¶ Bind config to a Run...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.ensemble.EnsembleRetriever.html
5872106cd19c-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...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.ensemble.EnsembleRetriever.html
5872106cd19c-10
property output_schema: Type[pydantic.main.BaseModel]¶ The type of output this runnable produces specified as a pydantic model. Examples using EnsembleRetriever¶ Ensemble Retriever
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.ensemble.EnsembleRetriever.html
342c695b6e24-0
langchain.retrievers.self_query.milvus.process_value¶ langchain.retrievers.self_query.milvus.process_value(value: Union[int, float, str]) → str[source]¶ Convert a value to a string and add double quotes if it is a string. It required for comparators involving strings. Parameters value – The value to convert. Returns Th...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.self_query.milvus.process_value.html
155ca0790b05-0
langchain.retrievers.milvus.MilvusRetreiver¶ langchain.retrievers.milvus.MilvusRetreiver(*args: Any, **kwargs: Any) → MilvusRetriever[source]¶ Deprecated MilvusRetreiver. Please use MilvusRetriever (‘i’ before ‘e’) instead. Parameters *args – **kwargs – Returns MilvusRetriever
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.milvus.MilvusRetreiver.html
cc3c96e4d43d-0
langchain.retrievers.self_query.redis.RedisTranslator¶ class langchain.retrievers.self_query.redis.RedisTranslator(schema: RedisModel)[source]¶ Translate Attributes allowed_comparators Subset of allowed logical comparators. allowed_operators Subset of allowed logical operators. Methods __init__(schema) from_vectorstore...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.self_query.redis.RedisTranslator.html
3829d6ae1c94-0
langchain.retrievers.self_query.milvus.MilvusTranslator¶ class langchain.retrievers.self_query.milvus.MilvusTranslator[source]¶ Translate Milvus internal query language elements to valid filters. Attributes allowed_comparators allowed_operators Subset of allowed logical comparators. Methods __init__() visit_comparison(...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.self_query.milvus.MilvusTranslator.html
b3d97f5fb7d0-0
langchain.retrievers.kendra.AmazonKendraRetriever¶ class langchain.retrievers.kendra.AmazonKendraRetriever[source]¶ Bases: BaseRetriever Amazon Kendra Index retriever. Parameters index_id – Kendra index id region_name – The aws region e.g., us-west-2. Fallsback to AWS_DEFAULT_REGION env variable or region specified in ...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.kendra.AmazonKendraRetriever.html
b3d97f5fb7d0-1
param metadata: Optional[Dict[str, Any]] = None¶ Optional metadata associated with the retriever. Defaults to None This metadata will be associated with each call to this retriever, and passed as arguments to the handlers defined in callbacks. You can use these to eg identify a specific instance of a retriever with its...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.kendra.AmazonKendraRetriever.html
b3d97f5fb7d0-2
Asynchronously get documents relevant to a query. :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 a...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.kendra.AmazonKendraRetriever.html
b3d97f5fb7d0-3
Stream all output from a runnable, as reported to the callback system. This includes all inner runs of LLMs, Retrievers, Tools, etc. Output is streamed as Log objects, which include a list of jsonpatch ops that describe how the state of the run has changed in each step, and the final state of the run. The jsonpatch ops...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.kendra.AmazonKendraRetriever.html
b3d97f5fb7d0-4
Returns A pydantic model that can be used to validate config. configurable_alternatives(which: ConfigurableField, default_key: str = 'default', **kwargs: Union[Runnable[Input, Output], Callable[[], Runnable[Input, Output]]]) → RunnableSerializable[Input, Output]¶ configurable_fields(**kwargs: Union[ConfigurableField, C...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.kendra.AmazonKendraRetriever.html
b3d97f5fb7d0-5
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...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.kendra.AmazonKendraRetriever.html
b3d97f5fb7d0-6
This method allows to get an output schema for a specific configuration. Parameters config – A config to use when generating the schema. Returns A pydantic model that can be used to validate output. get_relevant_documents(query: str, *, callbacks: Callbacks = None, tags: Optional[List[str]] = None, metadata: Optional[D...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.kendra.AmazonKendraRetriever.html
b3d97f5fb7d0-7
classmethod is_lc_serializable() → bool¶ Is this class serializable? 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_defa...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.kendra.AmazonKendraRetriever.html
b3d97f5fb7d0-8
classmethod schema_json(*, by_alias: bool = True, ref_template: unicode = '#/definitions/{model}', **dumps_kwargs: Any) → unicode¶ stream(input: Input, config: Optional[RunnableConfig] = None, **kwargs: Optional[Any]) → Iterator[Output]¶ Default implementation of stream, which calls invoke. Subclasses should override t...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.kendra.AmazonKendraRetriever.html
b3d97f5fb7d0-9
fallback in order, upon failures. with_listeners(*, on_start: Optional[Listener] = None, on_end: Optional[Listener] = None, on_error: Optional[Listener] = None) → Runnable[Input, Output]¶ Bind lifecycle listeners to a Runnable, returning a new Runnable. on_start: Called before the runnable starts running, with the Run ...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.kendra.AmazonKendraRetriever.html
b3d97f5fb7d0-10
The type of output this runnable produces specified as a type annotation. property config_specs: List[langchain.schema.runnable.utils.ConfigurableFieldSpec]¶ List configurable fields for this runnable. property input_schema: Type[pydantic.main.BaseModel]¶ The type of input this runnable accepts specified as a pydantic ...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.kendra.AmazonKendraRetriever.html
02ca97cafc8e-0
langchain.retrievers.self_query.weaviate.WeaviateTranslator¶ class langchain.retrievers.self_query.weaviate.WeaviateTranslator[source]¶ Translate Weaviate internal query language elements to valid filters. Attributes allowed_comparators allowed_operators Subset of allowed logical operators. Methods __init__() visit_com...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.self_query.weaviate.WeaviateTranslator.html
f3ace8d76703-0
langchain.retrievers.document_compressors.embeddings_filter.EmbeddingsFilter¶ class langchain.retrievers.document_compressors.embeddings_filter.EmbeddingsFilter[source]¶ Bases: BaseDocumentCompressor Document compressor that uses embeddings to drop documents unrelated to the query. Create a new model by parsing and val...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.document_compressors.embeddings_filter.EmbeddingsFilter.html
f3ace8d76703-1
Default values are respected, but no other validation is performed. Behaves as if Config.extra = ‘allow’ was set since it adds all passed values copy(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, update: Optional[DictStrAny...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.document_compressors.embeddings_filter.EmbeddingsFilter.html
f3ace8d76703-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...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.document_compressors.embeddings_filter.EmbeddingsFilter.html
a9578de201c2-0
langchain.retrievers.document_compressors.chain_filter.default_get_input¶ langchain.retrievers.document_compressors.chain_filter.default_get_input(query: str, doc: Document) → Dict[str, Any][source]¶ Return the compression chain input.
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.document_compressors.chain_filter.default_get_input.html
97773668c9ce-0
langchain.retrievers.document_compressors.cohere_rerank.CohereRerank¶ class langchain.retrievers.document_compressors.cohere_rerank.CohereRerank[source]¶ Bases: BaseDocumentCompressor Document compressor that uses Cohere Rerank API. Create a new model by parsing and validating input data from keyword arguments. Raises ...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.document_compressors.cohere_rerank.CohereRerank.html
97773668c9ce-1
Default values are respected, but no other validation is performed. Behaves as if Config.extra = ‘allow’ was set since it adds all passed values copy(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, update: Optional[DictStrAny...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.document_compressors.cohere_rerank.CohereRerank.html
97773668c9ce-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...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.document_compressors.cohere_rerank.CohereRerank.html
78ed37203d8b-0
langchain.retrievers.contextual_compression.ContextualCompressionRetriever¶ class langchain.retrievers.contextual_compression.ContextualCompressionRetriever[source]¶ Bases: BaseRetriever Retriever that wraps a base retriever and compresses the results. Create a new model by parsing and validating input data from keywor...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.contextual_compression.ContextualCompressionRetriever.html
78ed37203d8b-1
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. async aget_relevant_documents(query: str, *, callbacks: Callbacks = None, tags: Optional[List[str]] = None, metadata: Optional[Dict[str, Any]] = None, run_name: Optional[s...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.contextual_compression.ContextualCompressionRetriever.html
78ed37203d8b-2
Subclasses should override this method if they support streaming output. async astream_log(input: Any, config: Optional[RunnableConfig] = None, *, diff: bool = True, include_names: Optional[Sequence[str]] = None, include_types: Optional[Sequence[str]] = None, include_tags: Optional[Sequence[str]] = None, exclude_names:...
lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.contextual_compression.ContextualCompressionRetriever.html