id
stringlengths
14
15
text
stringlengths
13
2.7k
source
stringlengths
60
181
a9710718b108-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...
https://api.python.langchain.com/en/latest/retrievers/langchain_community.retrievers.databerry.DataberryRetriever.html
a9710718b108-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...
https://api.python.langchain.com/en/latest/retrievers/langchain_community.retrievers.databerry.DataberryRetriever.html
a9710718b108-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...
https://api.python.langchain.com/en/latest/retrievers/langchain_community.retrievers.databerry.DataberryRetriever.html
a9710718b108-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...
https://api.python.langchain.com/en/latest/retrievers/langchain_community.retrievers.databerry.DataberryRetriever.html
73015ddde02f-0
langchain_community.retrievers.svm.SVMRetriever¶ class langchain_community.retrievers.svm.SVMRetriever[source]¶ Bases: BaseRetriever SVM retriever. Largely based on https://github.com/karpathy/randomfun/blob/master/knn_vs_svm.ipynb Create a new model by parsing and validating input data from keyword arguments. Raises V...
https://api.python.langchain.com/en/latest/retrievers/langchain_community.retrievers.svm.SVMRetriever.html
73015ddde02f-1
param texts: List[str] [Required]¶ List of texts to index. 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 defaul...
https://api.python.langchain.com/en/latest/retrievers/langchain_community.retrievers.svm.SVMRetriever.html
73015ddde02f-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/retrievers/langchain_community.retrievers.svm.SVMRetriever.html
73015ddde02f-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/retrievers/langchain_community.retrievers.svm.SVMRetriever.html
73015ddde02f-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/retrievers/langchain_community.retrievers.svm.SVMRetriever.html
73015ddde02f-5
Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. classmethod from_documents(documents: Iterable[Document], embeddings: Embeddings, **kwargs: Any) → SVMRetriever[source]¶ classmethod from_orm(obj: Any) → Model¶ classmethod from_texts(texts: List[str], embedding...
https://api.python.langchain.com/en/latest/retrievers/langchain_community.retrievers.svm.SVMRetriever.html
73015ddde02f-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...
https://api.python.langchain.com/en/latest/retrievers/langchain_community.retrievers.svm.SVMRetriever.html
73015ddde02f-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...
https://api.python.langchain.com/en/latest/retrievers/langchain_community.retrievers.svm.SVMRetriever.html
73015ddde02f-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...
https://api.python.langchain.com/en/latest/retrievers/langchain_community.retrievers.svm.SVMRetriever.html
73015ddde02f-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 ...
https://api.python.langchain.com/en/latest/retrievers/langchain_community.retrievers.svm.SVMRetriever.html
73015ddde02f-10
property OutputType: Type[langchain_core.runnables.utils.Output]¶ The type of output this runnable produces specified as a type annotation. property config_specs: List[langchain_core.runnables.utils.ConfigurableFieldSpec]¶ List configurable fields for this runnable. property input_schema: Type[pydantic.main.BaseModel]¶...
https://api.python.langchain.com/en/latest/retrievers/langchain_community.retrievers.svm.SVMRetriever.html
d8209a685760-0
langchain_community.retrievers.kendra.QueryResult¶ class langchain_community.retrievers.kendra.QueryResult[source]¶ Bases: BaseModel Amazon Kendra Query API search result. It is composed of: Relevant suggested answers: either a text excerpt or table excerpt. Matching FAQs or questions-answer from your FAQ file. Documen...
https://api.python.langchain.com/en/latest/retrievers/langchain_community.retrievers.kendra.QueryResult.html
d8209a685760-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/retrievers/langchain_community.retrievers.kendra.QueryResult.html
d8209a685760-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/retrievers/langchain_community.retrievers.kendra.QueryResult.html
65ffb84c3665-0
langchain_community.retrievers.tfidf.TFIDFRetriever¶ class langchain_community.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 validati...
https://api.python.langchain.com/en/latest/retrievers/langchain_community.retrievers.tfidf.TFIDFRetriever.html
65ffb84c3665-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(...
https://api.python.langchain.com/en/latest/retrievers/langchain_community.retrievers.tfidf.TFIDFRetriever.html
65ffb84c3665-2
Subclasses should override this method if they support streaming output. async astream_log(input: Any, config: Optional[RunnableConfig] = None, *, diff: bool = True, with_streamed_output_list: bool = True, include_names: Optional[Sequence[str]] = None, include_types: Optional[Sequence[str]] = None, include_tags: Option...
https://api.python.langchain.com/en/latest/retrievers/langchain_community.retrievers.tfidf.TFIDFRetriever.html
65ffb84c3665-3
Default implementation of atransform, which buffers input and calls astream. Subclasses should override this method if they can start producing output while input is still being generated. batch(inputs: List[Input], config: Optional[Union[RunnableConfig, List[RunnableConfig]]] = None, *, return_exceptions: bool = False...
https://api.python.langchain.com/en/latest/retrievers/langchain_community.retrievers.tfidf.TFIDFRetriever.html
65ffb84c3665-4
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...
https://api.python.langchain.com/en/latest/retrievers/langchain_community.retrievers.tfidf.TFIDFRetriever.html
65ffb84c3665-5
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 depends on which configuration the runnable is...
https://api.python.langchain.com/en/latest/retrievers/langchain_community.retrievers.tfidf.TFIDFRetriever.html
65ffb84c3665-6
: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. Parameters metadata – Optional metadata associated with the retriever. Defaults to None This metadata will be a...
https://api.python.langchain.com/en/latest/retrievers/langchain_community.retrievers.tfidf.TFIDFRetriever.html
65ffb84c3665-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. classmethod load_local(folder_path: str, file_name: str = 'tfidf_vectorizer') → TFIDFRetriever[source]¶ map() → Runnable[List[Input], List[Output]]¶ Return a new Runnable that...
https://api.python.langchain.com/en/latest/retrievers/langchain_community.retrievers.tfidf.TFIDFRetriever.html
65ffb84c3665-8
Default implementation of transform, which buffers input and then calls stream. Subclasses should override this method if they can start producing output while input is still being generated. classmethod update_forward_refs(**localns: Any) → None¶ Try to update ForwardRefs on fields based on this Model, globalns and lo...
https://api.python.langchain.com/en/latest/retrievers/langchain_community.retrievers.tfidf.TFIDFRetriever.html
65ffb84c3665-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.tfidf.TFIDFRetriever.html
65ffb84c3665-10
property output_schema: Type[pydantic.main.BaseModel]¶ The type of output this runnable produces specified as a pydantic model. Examples using TFIDFRetriever¶ TF-IDF
https://api.python.langchain.com/en/latest/retrievers/langchain_community.retrievers.tfidf.TFIDFRetriever.html
08aa50722262-0
langchain_community.retrievers.docarray.SearchType¶ class langchain_community.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'¶
https://api.python.langchain.com/en/latest/retrievers/langchain_community.retrievers.docarray.SearchType.html
464c4797e4d6-0
langchain_community.retrievers.kendra.AdditionalResultAttributeValue¶ class langchain_community.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 th...
https://api.python.langchain.com/en/latest/retrievers/langchain_community.retrievers.kendra.AdditionalResultAttributeValue.html
464c4797e4d6-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/retrievers/langchain_community.retrievers.kendra.AdditionalResultAttributeValue.html
464c4797e4d6-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/retrievers/langchain_community.retrievers.kendra.AdditionalResultAttributeValue.html
f87bdc28b09c-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...
https://api.python.langchain.com/en/latest/retrievers/langchain.retrievers.self_query.milvus.process_value.html
9ed841a9111a-0
langchain_community.retrievers.llama_index.LlamaIndexRetriever¶ class langchain_community.retrievers.llama_index.LlamaIndexRetriever[source]¶ Bases: BaseRetriever LlamaIndex retriever. It is used for the question-answering with sources over an LlamaIndex data structure. Create a new model by parsing and validating inpu...
https://api.python.langchain.com/en/latest/retrievers/langchain_community.retrievers.llama_index.LlamaIndexRetriever.html
9ed841a9111a-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...
https://api.python.langchain.com/en/latest/retrievers/langchain_community.retrievers.llama_index.LlamaIndexRetriever.html
9ed841a9111a-2
Subclasses should override this method if they support streaming output. async astream_log(input: Any, config: Optional[RunnableConfig] = None, *, diff: bool = True, with_streamed_output_list: bool = True, include_names: Optional[Sequence[str]] = None, include_types: Optional[Sequence[str]] = None, include_tags: Option...
https://api.python.langchain.com/en/latest/retrievers/langchain_community.retrievers.llama_index.LlamaIndexRetriever.html
9ed841a9111a-3
Default implementation of atransform, which buffers input and calls astream. Subclasses should override this method if they can start producing output while input is still being generated. batch(inputs: List[Input], config: Optional[Union[RunnableConfig, List[RunnableConfig]]] = None, *, return_exceptions: bool = False...
https://api.python.langchain.com/en/latest/retrievers/langchain_community.retrievers.llama_index.LlamaIndexRetriever.html
9ed841a9111a-4
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...
https://api.python.langchain.com/en/latest/retrievers/langchain_community.retrievers.llama_index.LlamaIndexRetriever.html
9ed841a9111a-5
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_lc_namespace() → List[str]¶ Get the namespace of the langchain object. For example, if the class is langcha...
https://api.python.langchain.com/en/latest/retrievers/langchain_community.retrievers.llama_index.LlamaIndexRetriever.html
9ed841a9111a-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...
https://api.python.langchain.com/en/latest/retrievers/langchain_community.retrievers.llama_index.LlamaIndexRetriever.html
9ed841a9111a-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...
https://api.python.langchain.com/en/latest/retrievers/langchain_community.retrievers.llama_index.LlamaIndexRetriever.html
9ed841a9111a-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...
https://api.python.langchain.com/en/latest/retrievers/langchain_community.retrievers.llama_index.LlamaIndexRetriever.html
9ed841a9111a-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...
https://api.python.langchain.com/en/latest/retrievers/langchain_community.retrievers.llama_index.LlamaIndexRetriever.html
905bc9d67c49-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...
https://api.python.langchain.com/en/latest/retrievers/langchain.retrievers.document_compressors.base.DocumentCompressorPipeline.html
905bc9d67c49-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...
https://api.python.langchain.com/en/latest/retrievers/langchain.retrievers.document_compressors.base.DocumentCompressorPipeline.html
905bc9d67c49-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...
https://api.python.langchain.com/en/latest/retrievers/langchain.retrievers.document_compressors.base.DocumentCompressorPipeline.html
35798cdb05a2-0
langchain_community.retrievers.bedrock.RetrievalConfig¶ class langchain_community.retrievers.bedrock.RetrievalConfig[source]¶ Bases: BaseModel 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 vectorSear...
https://api.python.langchain.com/en/latest/retrievers/langchain_community.retrievers.bedrock.RetrievalConfig.html
35798cdb05a2-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/retrievers/langchain_community.retrievers.bedrock.RetrievalConfig.html
35798cdb05a2-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/retrievers/langchain_community.retrievers.bedrock.RetrievalConfig.html
f15024dafe23-0
langchain_community.retrievers.cohere_rag_retriever.CohereRagRetriever¶ class langchain_community.retrievers.cohere_rag_retriever.CohereRagRetriever[source]¶ Bases: BaseRetriever Cohere Chat API with RAG. Create a new model by parsing and validating input data from keyword arguments. Raises ValidationError if the input...
https://api.python.langchain.com/en/latest/retrievers/langchain_community.retrievers.cohere_rag_retriever.CohereRagRetriever.html
f15024dafe23-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(...
https://api.python.langchain.com/en/latest/retrievers/langchain_community.retrievers.cohere_rag_retriever.CohereRagRetriever.html
f15024dafe23-2
Subclasses should override this method if they support streaming output. async astream_log(input: Any, config: Optional[RunnableConfig] = None, *, diff: bool = True, with_streamed_output_list: bool = True, include_names: Optional[Sequence[str]] = None, include_types: Optional[Sequence[str]] = None, include_tags: Option...
https://api.python.langchain.com/en/latest/retrievers/langchain_community.retrievers.cohere_rag_retriever.CohereRagRetriever.html
f15024dafe23-3
Default implementation of atransform, which buffers input and calls astream. Subclasses should override this method if they can start producing output while input is still being generated. batch(inputs: List[Input], config: Optional[Union[RunnableConfig, List[RunnableConfig]]] = None, *, return_exceptions: bool = False...
https://api.python.langchain.com/en/latest/retrievers/langchain_community.retrievers.cohere_rag_retriever.CohereRagRetriever.html
f15024dafe23-4
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...
https://api.python.langchain.com/en/latest/retrievers/langchain_community.retrievers.cohere_rag_retriever.CohereRagRetriever.html
f15024dafe23-5
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_lc_namespace() → List[str]¶ Get the namespace of the langchain object. For example, if the class is langcha...
https://api.python.langchain.com/en/latest/retrievers/langchain_community.retrievers.cohere_rag_retriever.CohereRagRetriever.html
f15024dafe23-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...
https://api.python.langchain.com/en/latest/retrievers/langchain_community.retrievers.cohere_rag_retriever.CohereRagRetriever.html
f15024dafe23-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...
https://api.python.langchain.com/en/latest/retrievers/langchain_community.retrievers.cohere_rag_retriever.CohereRagRetriever.html
f15024dafe23-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...
https://api.python.langchain.com/en/latest/retrievers/langchain_community.retrievers.cohere_rag_retriever.CohereRagRetriever.html
f15024dafe23-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...
https://api.python.langchain.com/en/latest/retrievers/langchain_community.retrievers.cohere_rag_retriever.CohereRagRetriever.html
9fd9358bf929-0
langchain_community.retrievers.kendra.combined_text¶ langchain_community.retrievers.kendra.combined_text(item: ResultItem) → str[source]¶ Combine a ResultItem title and excerpt into a single string. Parameters item – the ResultItem of a Kendra search. Returns A combined text of the title and excerpt of the given item.
https://api.python.langchain.com/en/latest/retrievers/langchain_community.retrievers.kendra.combined_text.html
a1e6720256df-0
langchain_experimental.retrievers.vector_sql_database.VectorSQLDatabaseChainRetriever¶ class langchain_experimental.retrievers.vector_sql_database.VectorSQLDatabaseChainRetriever[source]¶ Bases: BaseRetriever Retriever that uses SQLDatabase as Retriever Create a new model by parsing and validating input data from keywo...
https://api.python.langchain.com/en/latest/retrievers/langchain_experimental.retrievers.vector_sql_database.VectorSQLDatabaseChainRetriever.html
a1e6720256df-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...
https://api.python.langchain.com/en/latest/retrievers/langchain_experimental.retrievers.vector_sql_database.VectorSQLDatabaseChainRetriever.html
a1e6720256df-2
Subclasses should override this method if they support streaming output. async astream_log(input: Any, config: Optional[RunnableConfig] = None, *, diff: bool = True, with_streamed_output_list: bool = True, include_names: Optional[Sequence[str]] = None, include_types: Optional[Sequence[str]] = None, include_tags: Option...
https://api.python.langchain.com/en/latest/retrievers/langchain_experimental.retrievers.vector_sql_database.VectorSQLDatabaseChainRetriever.html
a1e6720256df-3
Default implementation of atransform, which buffers input and calls astream. Subclasses should override this method if they can start producing output while input is still being generated. batch(inputs: List[Input], config: Optional[Union[RunnableConfig, List[RunnableConfig]]] = None, *, return_exceptions: bool = False...
https://api.python.langchain.com/en/latest/retrievers/langchain_experimental.retrievers.vector_sql_database.VectorSQLDatabaseChainRetriever.html
a1e6720256df-4
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...
https://api.python.langchain.com/en/latest/retrievers/langchain_experimental.retrievers.vector_sql_database.VectorSQLDatabaseChainRetriever.html
a1e6720256df-5
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_lc_namespace() → List[str]¶ Get the namespace of the langchain object. For example, if the class is langcha...
https://api.python.langchain.com/en/latest/retrievers/langchain_experimental.retrievers.vector_sql_database.VectorSQLDatabaseChainRetriever.html
a1e6720256df-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...
https://api.python.langchain.com/en/latest/retrievers/langchain_experimental.retrievers.vector_sql_database.VectorSQLDatabaseChainRetriever.html
a1e6720256df-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...
https://api.python.langchain.com/en/latest/retrievers/langchain_experimental.retrievers.vector_sql_database.VectorSQLDatabaseChainRetriever.html
a1e6720256df-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...
https://api.python.langchain.com/en/latest/retrievers/langchain_experimental.retrievers.vector_sql_database.VectorSQLDatabaseChainRetriever.html
a1e6720256df-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...
https://api.python.langchain.com/en/latest/retrievers/langchain_experimental.retrievers.vector_sql_database.VectorSQLDatabaseChainRetriever.html
841d9eb35a8b-0
langchain_community.retrievers.svm.create_index¶ langchain_community.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 e...
https://api.python.langchain.com/en/latest/retrievers/langchain_community.retrievers.svm.create_index.html
59f731f90840-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...
https://api.python.langchain.com/en/latest/retrievers/langchain.retrievers.document_compressors.chain_extract.LLMChainExtractor.html
59f731f90840-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...
https://api.python.langchain.com/en/latest/retrievers/langchain.retrievers.document_compressors.chain_extract.LLMChainExtractor.html
59f731f90840-2
Initialize from LLM. 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: bo...
https://api.python.langchain.com/en/latest/retrievers/langchain.retrievers.document_compressors.chain_extract.LLMChainExtractor.html
7502676d7662-0
langchain_community.retrievers.bedrock.VectorSearchConfig¶ class langchain_community.retrievers.bedrock.VectorSearchConfig[source]¶ Bases: BaseModel 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 numb...
https://api.python.langchain.com/en/latest/retrievers/langchain_community.retrievers.bedrock.VectorSearchConfig.html
7502676d7662-1
Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. classmethod from_orm(obj: Any) → Model¶ json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False,...
https://api.python.langchain.com/en/latest/retrievers/langchain_community.retrievers.bedrock.VectorSearchConfig.html
a7b4630168c2-0
langchain.retrievers.self_query.vectara.VectaraTranslator¶ class langchain.retrievers.self_query.vectara.VectaraTranslator[source]¶ Translate Vectara internal query language elements to valid filters. Attributes allowed_comparators Subset of allowed logical comparators. allowed_operators Subset of allowed logical opera...
https://api.python.langchain.com/en/latest/retrievers/langchain.retrievers.self_query.vectara.VectaraTranslator.html
b74c5a73fb9f-0
langchain_community.retrievers.embedchain.EmbedchainRetriever¶ class langchain_community.retrievers.embedchain.EmbedchainRetriever[source]¶ Bases: BaseRetriever Embedchain retriever. Create a new model by parsing and validating input data from keyword arguments. Raises ValidationError if the input data cannot be parsed...
https://api.python.langchain.com/en/latest/retrievers/langchain_community.retrievers.embedchain.EmbedchainRetriever.html
b74c5a73fb9f-1
Parameters texts – Iterable of strings/URLs to add to the retriever. Returns List of ids from adding the texts into the retriever. 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, **kwar...
https://api.python.langchain.com/en/latest/retrievers/langchain_community.retrievers.embedchain.EmbedchainRetriever.html
b74c5a73fb9f-2
Subclasses should override this method if they support streaming output. async astream_log(input: Any, config: Optional[RunnableConfig] = None, *, diff: bool = True, with_streamed_output_list: bool = True, include_names: Optional[Sequence[str]] = None, include_types: Optional[Sequence[str]] = None, include_tags: Option...
https://api.python.langchain.com/en/latest/retrievers/langchain_community.retrievers.embedchain.EmbedchainRetriever.html
b74c5a73fb9f-3
Default implementation of atransform, which buffers input and calls astream. Subclasses should override this method if they can start producing output while input is still being generated. batch(inputs: List[Input], config: Optional[Union[RunnableConfig, List[RunnableConfig]]] = None, *, return_exceptions: bool = False...
https://api.python.langchain.com/en/latest/retrievers/langchain_community.retrievers.embedchain.EmbedchainRetriever.html
b74c5a73fb9f-4
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...
https://api.python.langchain.com/en/latest/retrievers/langchain_community.retrievers.embedchain.EmbedchainRetriever.html
b74c5a73fb9f-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...
https://api.python.langchain.com/en/latest/retrievers/langchain_community.retrievers.embedchain.EmbedchainRetriever.html
b74c5a73fb9f-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 invoke...
https://api.python.langchain.com/en/latest/retrievers/langchain_community.retrievers.embedchain.EmbedchainRetriever.html
b74c5a73fb9f-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 =...
https://api.python.langchain.com/en/latest/retrievers/langchain_community.retrievers.embedchain.EmbedchainRetriever.html
b74c5a73fb9f-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...
https://api.python.langchain.com/en/latest/retrievers/langchain_community.retrievers.embedchain.EmbedchainRetriever.html
b74c5a73fb9f-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 ...
https://api.python.langchain.com/en/latest/retrievers/langchain_community.retrievers.embedchain.EmbedchainRetriever.html
759297f40a49-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...
https://api.python.langchain.com/en/latest/retrievers/langchain.retrievers.web_research.WebResearchRetriever.html
759297f40a49-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...
https://api.python.langchain.com/en/latest/retrievers/langchain.retrievers.web_research.WebResearchRetriever.html
759297f40a49-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/retrievers/langchain.retrievers.web_research.WebResearchRetriever.html
759297f40a49-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/retrievers/langchain.retrievers.web_research.WebResearchRetriever.html
759297f40a49-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/retrievers/langchain.retrievers.web_research.WebResearchRetriever.html
759297f40a49-5
Generate a dictionary representation of the model, optionally specifying which fields to include or exclude. classmethod from_llm(vectorstore: ~langchain_core.vectorstores.VectorStore, llm: ~langchain_core.language_models.llms.BaseLLM, search: ~langchain_community.utilities.google_search.GoogleSearchAPIWrapper, prompt:...
https://api.python.langchain.com/en/latest/retrievers/langchain.retrievers.web_research.WebResearchRetriever.html
759297f40a49-6
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...
https://api.python.langchain.com/en/latest/retrievers/langchain.retrievers.web_research.WebResearchRetriever.html
759297f40a49-7
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]]...
https://api.python.langchain.com/en/latest/retrievers/langchain.retrievers.web_research.WebResearchRetriever.html
759297f40a49-8
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¶ search_tool(query: str, num_search_results: int = 1) → List[dict][source]¶ Returns n...
https://api.python.langchain.com/en/latest/retrievers/langchain.retrievers.web_research.WebResearchRetriever.html
759297f40a49-9
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...
https://api.python.langchain.com/en/latest/retrievers/langchain.retrievers.web_research.WebResearchRetriever.html
759297f40a49-10
Bind input and output types to a Runnable, returning a new Runnable. property InputType: Type[langchain_core.runnables.utils.Input]¶ The type of input this runnable accepts specified as a type annotation. property OutputType: Type[langchain_core.runnables.utils.Output]¶ The type of output this runnable produces specifi...
https://api.python.langchain.com/en/latest/retrievers/langchain.retrievers.web_research.WebResearchRetriever.html
c758ab9389b7-0
langchain_community.retrievers.kendra.RetrieveResult¶ class langchain_community.retrievers.kendra.RetrieveResult[source]¶ Bases: BaseModel Amazon Kendra Retrieve API search result. It is composed of: relevant passages or text excerpts given an input query. Create a new model by parsing and validating input data from ke...
https://api.python.langchain.com/en/latest/retrievers/langchain_community.retrievers.kendra.RetrieveResult.html