id stringlengths 14 16 | text stringlengths 13 2.7k | source stringlengths 57 178 |
|---|---|---|
f87c3ac7a53e-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... | lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.kendra.AdditionalResultAttribute.html |
f87c3ac7a53e-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... | lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.kendra.AdditionalResultAttribute.html |
7fde6f7c480b-0 | langchain.retrievers.pinecone_hybrid_search.hash_text¶
langchain.retrievers.pinecone_hybrid_search.hash_text(text: str) → str[source]¶
Hash a text using SHA256.
Parameters
text – Text to hash.
Returns
Hashed text. | lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.pinecone_hybrid_search.hash_text.html |
dc18b9d6151e-0 | langchain.retrievers.re_phraser.RePhraseQueryRetriever¶
class langchain.retrievers.re_phraser.RePhraseQueryRetriever[source]¶
Bases: BaseRetriever
Given a query, use an LLM to re-phrase it.
Then, retrieve docs for the re-phrased query.
Create a new model by parsing and validating input data from keyword arguments.
Rais... | lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.re_phraser.RePhraseQueryRetriever.html |
dc18b9d6151e-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.re_phraser.RePhraseQueryRetriever.html |
dc18b9d6151e-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.re_phraser.RePhraseQueryRetriever.html |
dc18b9d6151e-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.re_phraser.RePhraseQueryRetriever.html |
dc18b9d6151e-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.re_phraser.RePhraseQueryRetriever.html |
dc18b9d6151e-5 | Runnables that leverage the configurable_fields and configurable_alternatives
methods will have a dynamic input schema that depends on which
configuration the runnable is invoked with.
This method allows to get an input schema for a specific configuration.
Parameters
config – A config to use when generating the schema.... | lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.re_phraser.RePhraseQueryRetriever.html |
dc18b9d6151e-6 | Parameters
metadata – 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.
Returns
List of relevant documents
invoke(input: str, config: Optional[RunnableConfig] = None) → List[D... | lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.re_phraser.RePhraseQueryRetriever.html |
dc18b9d6151e-7 | 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 each input.
classmethod parse_file(path: Union[str, Path], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: Protocol = None, allow_pickle: bool =... | lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.re_phraser.RePhraseQueryRetriever.html |
dc18b9d6151e-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.re_phraser.RePhraseQueryRetriever.html |
dc18b9d6151e-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.re_phraser.RePhraseQueryRetriever.html |
4594d0e3389a-0 | langchain.retrievers.self_query.timescalevector.TimescaleVectorTranslator¶
class langchain.retrievers.self_query.timescalevector.TimescaleVectorTranslator[source]¶
Translate the internal query language elements to valid filters.
Attributes
COMPARATOR_MAP
OPERATOR_MAP
allowed_comparators
allowed_operators
Subset of allo... | lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.self_query.timescalevector.TimescaleVectorTranslator.html |
e2cc0f83400a-0 | langchain.retrievers.self_query.myscale.MyScaleTranslator¶
class langchain.retrievers.self_query.myscale.MyScaleTranslator(metadata_key: str = 'metadata')[source]¶
Translate MyScale internal query language elements to valid filters.
Attributes
allowed_comparators
allowed_operators
Subset of allowed logical operators.
m... | lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.self_query.myscale.MyScaleTranslator.html |
6a55126dfc6e-0 | langchain.retrievers.databerry.DataberryRetriever¶
class langchain.retrievers.databerry.DataberryRetriever[source]¶
Bases: BaseRetriever
Databerry 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 form a valid mode... | lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.databerry.DataberryRetriever.html |
6a55126dfc6e-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.databerry.DataberryRetriever.html |
6a55126dfc6e-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.databerry.DataberryRetriever.html |
6a55126dfc6e-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.databerry.DataberryRetriever.html |
6a55126dfc6e-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.databerry.DataberryRetriever.html |
6a55126dfc6e-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.databerry.DataberryRetriever.html |
6a55126dfc6e-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.databerry.DataberryRetriever.html |
6a55126dfc6e-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.databerry.DataberryRetriever.html |
6a55126dfc6e-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.databerry.DataberryRetriever.html |
6a55126dfc6e-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.databerry.DataberryRetriever.html |
8c0928ca14a3-0 | langchain.retrievers.docarray.SearchType¶
class langchain.retrievers.docarray.SearchType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Enumerator of the types of search to perform.
similarity = 'similarity'¶
mmr = 'mmr'¶ | lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.docarray.SearchType.html |
7c9e3e7bc736-0 | langchain.retrievers.svm.create_index¶
langchain.retrievers.svm.create_index(contexts: List[str], embeddings: Embeddings) → ndarray[source]¶
Create an index of embeddings for a list of contexts.
Parameters
contexts – List of contexts to embed.
embeddings – Embeddings model to use.
Returns
Index of embeddings. | lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.svm.create_index.html |
9027fff0e8a9-0 | langchain.retrievers.multi_query.MultiQueryRetriever¶
class langchain.retrievers.multi_query.MultiQueryRetriever[source]¶
Bases: BaseRetriever
Given a query, use an LLM to write a set of queries.
Retrieve docs for each query. Return the unique union of all retrieved docs.
Create a new model by parsing and validating in... | lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.multi_query.MultiQueryRetriever.html |
9027fff0e8a9-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 agenerate_queries(questi... | lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.multi_query.MultiQueryRetriever.html |
9027fff0e8a9-2 | Subclasses should override this method if they can run asynchronously.
async aretrieve_documents(queries: List[str], run_manager: AsyncCallbackManagerForRetrieverRun) → List[Document][source]¶
Run all LLM generated queries.
Parameters
queries – query list
Returns
List of retrieved Documents
async astream(input: Input, ... | lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.multi_query.MultiQueryRetriever.html |
9027fff0e8a9-3 | input is still being generated.
batch(inputs: List[Input], config: Optional[Union[RunnableConfig, List[RunnableConfig]]] = None, *, return_exceptions: bool = False, **kwargs: Optional[Any]) → List[Output]¶
Default implementation runs invoke in parallel using a thread pool executor.
The default implementation of batch w... | lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.multi_query.MultiQueryRetriever.html |
9027fff0e8a9-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.multi_query.MultiQueryRetriever.html |
9027fff0e8a9-5 | Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.
classmethod from_llm(retriever: BaseRetriever, llm: BaseLLM, prompt: PromptTemplate = PromptTemplate(input_variables=['question'], template='You are an AI language model assistant. Your task is \n to generate... | lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.multi_query.MultiQueryRetriever.html |
9027fff0e8a9-6 | Parameters
config – A config to use when generating the schema.
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”, “open... | lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.multi_query.MultiQueryRetriever.html |
9027fff0e8a9-7 | and passed as arguments to the handlers defined in callbacks.
Returns
List of relevant documents
invoke(input: str, config: Optional[RunnableConfig] = None) → List[Document]¶
Transform a single input into an output. Override to implement.
Parameters
input – The input to the runnable.
config – A config to use when invok... | lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.multi_query.MultiQueryRetriever.html |
9027fff0e8a9-8 | 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.multi_query.MultiQueryRetriever.html |
9027fff0e8a9-9 | Parameters
documents – List of retrieved Documents
Returns
List of unique retrieved Documents
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] = No... | lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.multi_query.MultiQueryRetriever.html |
9027fff0e8a9-10 | 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.multi_query.MultiQueryRetriever.html |
9027fff0e8a9-11 | property output_schema: Type[pydantic.main.BaseModel]¶
The type of output this runnable produces specified as a pydantic model.
Examples using MultiQueryRetriever¶
Question Answering
MultiQueryRetriever | lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.multi_query.MultiQueryRetriever.html |
5b6b36a8b1bd-0 | langchain.retrievers.kay.KayAiRetriever¶
class langchain.retrievers.kay.KayAiRetriever[source]¶
Bases: BaseRetriever
Retriever for Kay.ai datasets.
To work properly, expects you to have KAY_API_KEY env variable set.
You can get one for free at https://kay.ai/.
Create a new model by parsing and validating input data fro... | lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.kay.KayAiRetriever.html |
5b6b36a8b1bd-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.kay.KayAiRetriever.html |
5b6b36a8b1bd-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.kay.KayAiRetriever.html |
5b6b36a8b1bd-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.kay.KayAiRetriever.html |
5b6b36a8b1bd-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
classmeth... | lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.kay.KayAiRetriever.html |
5b6b36a8b1bd-5 | methods will have a dynamic input schema that depends on which
configuration the runnable is invoked with.
This method allows to get an input 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 input.
classmethod get_... | lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.kay.KayAiRetriever.html |
5b6b36a8b1bd-6 | This metadata will be associated with each call to this retriever,
and passed as arguments to the handlers defined in callbacks.
Returns
List of relevant documents
invoke(input: str, config: Optional[RunnableConfig] = None) → List[Document]¶
Transform a single input into an output. Override to implement.
Parameters
inp... | lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.kay.KayAiRetriever.html |
5b6b36a8b1bd-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.kay.KayAiRetriever.html |
5b6b36a8b1bd-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.kay.KayAiRetriever.html |
5b6b36a8b1bd-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.kay.KayAiRetriever.html |
24d339a7146e-0 | langchain.retrievers.parent_document_retriever.ParentDocumentRetriever¶
class langchain.retrievers.parent_document_retriever.ParentDocumentRetriever[source]¶
Bases: MultiVectorRetriever
Retrieve small chunks then retrieve their parent documents.
When splitting documents for retrieval, there are often conflicting desire... | lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.parent_document_retriever.ParentDocumentRetriever.html |
24d339a7146e-1 | docstore=store,
child_splitter=child_splitter,
parent_splitter=parent_splitter,
)
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 child_splitter: langchain.text_splitter.TextSplitter [Required]... | lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.parent_document_retriever.ParentDocumentRetriever.html |
24d339a7146e-2 | The underlying vectorstore to use to store small chunks
and their embedding vectors
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 a... | lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.parent_document_retriever.ParentDocumentRetriever.html |
24d339a7146e-3 | :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... | lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.parent_document_retriever.ParentDocumentRetriever.html |
24d339a7146e-4 | 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 can be applied in order to construct state.
async atransform(input: As... | lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.parent_document_retriever.ParentDocumentRetriever.html |
24d339a7146e-5 | 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.parent_document_retriever.ParentDocumentRetriever.html |
24d339a7146e-6 | 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.parent_document_retriever.ParentDocumentRetriever.html |
24d339a7146e-7 | 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.parent_document_retriever.ParentDocumentRetriever.html |
24d339a7146e-8 | 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.parent_document_retriever.ParentDocumentRetriever.html |
24d339a7146e-9 | 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.parent_document_retriever.ParentDocumentRetriever.html |
24d339a7146e-10 | 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.parent_document_retriever.ParentDocumentRetriever.html |
24d339a7146e-11 | 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.parent_document_retriever.ParentDocumentRetriever.html |
72e1872c3278-0 | langchain.retrievers.document_compressors.chain_filter.LLMChainFilter¶
class langchain.retrievers.document_compressors.chain_filter.LLMChainFilter[source]¶
Bases: BaseDocumentCompressor
Filter that drops documents that aren’t relevant to the query.
Create a new model by parsing and validating input data from keyword ar... | lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.document_compressors.chain_filter.LLMChainFilter.html |
72e1872c3278-1 | 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.document_compressors.chain_filter.LLMChainFilter.html |
72e1872c3278-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.chain_filter.LLMChainFilter.html |
4280b6c05b30-0 | langchain.retrievers.kendra.AdditionalResultAttributeValue¶
class langchain.retrievers.kendra.AdditionalResultAttributeValue[source]¶
Bases: BaseModel
Value of an additional result attribute.
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot ... | lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.kendra.AdditionalResultAttributeValue.html |
4280b6c05b30-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... | lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.kendra.AdditionalResultAttributeValue.html |
4280b6c05b30-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... | lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.kendra.AdditionalResultAttributeValue.html |
6a85d7763413-0 | langchain.retrievers.wikipedia.WikipediaRetriever¶
class langchain.retrievers.wikipedia.WikipediaRetriever[source]¶
Bases: BaseRetriever, WikipediaAPIWrapper
Wikipedia API retriever.
It wraps load() to get_relevant_documents().
It uses all WikipediaAPIWrapper arguments without any change.
Create a new model by parsing ... | lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.wikipedia.WikipediaRetriever.html |
6a85d7763413-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.wikipedia.WikipediaRetriever.html |
6a85d7763413-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.wikipedia.WikipediaRetriever.html |
6a85d7763413-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.wikipedia.WikipediaRetriever.html |
6a85d7763413-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.wikipedia.WikipediaRetriever.html |
6a85d7763413-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.wikipedia.WikipediaRetriever.html |
6a85d7763413-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.wikipedia.WikipediaRetriever.html |
6a85d7763413-7 | run(query: str) → str¶
Run Wikipedia search and get page summaries.
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: In... | lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.wikipedia.WikipediaRetriever.html |
6a85d7763413-8 | 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.wikipedia.WikipediaRetriever.html |
6a85d7763413-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.wikipedia.WikipediaRetriever.html |
b89b854c172e-0 | langchain.retrievers.time_weighted_retriever.TimeWeightedVectorStoreRetriever¶
class langchain.retrievers.time_weighted_retriever.TimeWeightedVectorStoreRetriever[source]¶
Bases: BaseRetriever
Retriever that combines embedding similarity with
recency in retrieving values.
Create a new model by parsing and validating in... | lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.time_weighted_retriever.TimeWeightedVectorStoreRetriever.html |
b89b854c172e-1 | 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
use case.
param vectorstore: langchain.schema.vectorstore.VectorStore [Required]¶
The vectorstore to store documents and determine salience.
async aadd_documents(documents: List[Doc... | lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.time_weighted_retriever.TimeWeightedVectorStoreRetriever.html |
b89b854c172e-2 | This metadata will be associated with each call to this retriever,
and passed as arguments to the handlers defined in callbacks.
Returns
List of relevant documents
async ainvoke(input: str, config: Optional[RunnableConfig] = None, **kwargs: Optional[Any]) → List[Document]¶
Default implementation of ainvoke, calls invok... | lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.time_weighted_retriever.TimeWeightedVectorStoreRetriever.html |
b89b854c172e-3 | The jsonpatch ops can be applied in order to construct state.
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 should override this method if th... | lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.time_weighted_retriever.TimeWeightedVectorStoreRetriever.html |
b89b854c172e-4 | 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 validation is performed.
Behaves as if Config.extra = ‘allow’ was set since it adds all passed values... | lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.time_weighted_retriever.TimeWeightedVectorStoreRetriever.html |
b89b854c172e-5 | 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 depends on which
configuration the runnable is invoked with.
This method allows to get an input schema for a specific confi... | lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.time_weighted_retriever.TimeWeightedVectorStoreRetriever.html |
b89b854c172e-6 | and passed as arguments to the handlers defined in callbacks.
Parameters
metadata – 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.
Returns
List of relevant documents
get_sa... | lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.time_weighted_retriever.TimeWeightedVectorStoreRetriever.html |
b89b854c172e-7 | 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 each input.
classmethod parse_file... | lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.time_weighted_retriever.TimeWeightedVectorStoreRetriever.html |
b89b854c172e-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... | lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.time_weighted_retriever.TimeWeightedVectorStoreRetriever.html |
b89b854c172e-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.time_weighted_retriever.TimeWeightedVectorStoreRetriever.html |
b89b854c172e-10 | property output_schema: Type[pydantic.main.BaseModel]¶
The type of output this runnable produces specified as a pydantic model.
Examples using TimeWeightedVectorStoreRetriever¶
Generative Agents in LangChain | lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.time_weighted_retriever.TimeWeightedVectorStoreRetriever.html |
3ee23b6ac95e-0 | langchain.retrievers.zep.SearchType¶
class langchain.retrievers.zep.SearchType(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Enumerator of the types of search to perform.
similarity = 'similarity'¶
Similarity search.
mmr = 'mmr'¶
Maximal Marginal Relevance reranking of si... | lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.zep.SearchType.html |
f2f9be4a0de2-0 | langchain.retrievers.document_compressors.chain_extract.LLMChainExtractor¶
class langchain.retrievers.document_compressors.chain_extract.LLMChainExtractor[source]¶
Bases: BaseDocumentCompressor
Document compressor that uses an LLM chain to extract
the relevant parts of documents.
Create a new model by parsing and valid... | lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.document_compressors.chain_extract.LLMChainExtractor.html |
f2f9be4a0de2-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... | lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.document_compressors.chain_extract.LLMChainExtractor.html |
f2f9be4a0de2-2 | Generate a JSON representation of the model, include and exclude arguments as per dict().
encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().
classmethod parse_file(path: Union[str, Path], *, content_type: unicode = None, encoding: unicode = 'utf8', proto: Protocol... | lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.document_compressors.chain_extract.LLMChainExtractor.html |
2c45ea1ac427-0 | langchain.retrievers.zilliz.ZillizRetriever¶
class langchain.retrievers.zilliz.ZillizRetriever[source]¶
Bases: BaseRetriever
Zilliz 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 form a valid model.
param collec... | lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.zilliz.ZillizRetriever.html |
2c45ea1ac427-1 | use case.
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 batch works well for IO bound... | lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.zilliz.ZillizRetriever.html |
2c45ea1ac427-2 | Default implementation of ainvoke, calls invoke from a thread.
The default implementation allows usage of async code even if
the runnable did not implement a native async version of invoke.
Subclasses should override this method if they can run asynchronously.
async astream(input: Input, config: Optional[RunnableConfig... | lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.zilliz.ZillizRetriever.html |
2c45ea1ac427-3 | input is still being generated.
batch(inputs: List[Input], config: Optional[Union[RunnableConfig, List[RunnableConfig]]] = None, *, return_exceptions: bool = False, **kwargs: Optional[Any]) → List[Output]¶
Default implementation runs invoke in parallel using a thread pool executor.
The default implementation of batch w... | lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.zilliz.ZillizRetriever.html |
2c45ea1ac427-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.zilliz.ZillizRetriever.html |
2c45ea1ac427-5 | Parameters
config – A config to use when generating the schema.
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”, “open... | lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.zilliz.ZillizRetriever.html |
2c45ea1ac427-6 | and passed as arguments to the handlers defined in callbacks.
Returns
List of relevant documents
invoke(input: str, config: Optional[RunnableConfig] = None) → List[Document]¶
Transform a single input into an output. Override to implement.
Parameters
input – The input to the runnable.
config – A config to use when invok... | lang/api.python.langchain.com/en/latest/retrievers/langchain.retrievers.zilliz.ZillizRetriever.html |
2c45ea1ac427-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.zilliz.ZillizRetriever.html |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.