id stringlengths 14 15 | text stringlengths 49 2.47k | source stringlengths 61 166 |
|---|---|---|
57dcef2c6dcb-0 | langchain.retrievers.document_compressors.base.BaseDocumentCompressor¶
class langchain.retrievers.document_compressors.base.BaseDocumentCompressor[source]¶
Bases: BaseModel, ABC
Base abstraction interface for document compression.
Create a new model by parsing and validating input data from keyword arguments.
Raises Va... | https://api.python.langchain.com/en/latest/retrievers/langchain.retrievers.document_compressors.base.BaseDocumentCompressor.html |
57dcef2c6dcb-1 | 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(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, exclude: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, by_alias: bool = False, skip_defaults: Optional[boo... | https://api.python.langchain.com/en/latest/retrievers/langchain.retrievers.document_compressors.base.BaseDocumentCompressor.html |
57dcef2c6dcb-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.retrievers.document_compressors.base.BaseDocumentCompressor.html |
eae9e1a8d6fe-0 | langchain.retrievers.self_query.deeplake.can_cast_to_float¶
langchain.retrievers.self_query.deeplake.can_cast_to_float(string: str) → bool[source]¶
Check if a string can be cast to a float. | https://api.python.langchain.com/en/latest/retrievers/langchain.retrievers.self_query.deeplake.can_cast_to_float.html |
d3c837888886-0 | langchain.retrievers.document_compressors.chain_extract.NoOutputParser¶
class langchain.retrievers.document_compressors.chain_extract.NoOutputParser[source]¶
Bases: BaseOutputParser[str]
Parse outputs that could return a null string of some sort.
Create a new model by parsing and validating input data from keyword argu... | https://api.python.langchain.com/en/latest/retrievers/langchain.retrievers.document_compressors.chain_extract.NoOutputParser.html |
d3c837888886-1 | bind(**kwargs: Any) → Runnable[Input, Output]¶
Bind arguments to a Runnable, returning a new Runnable.
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 othe... | https://api.python.langchain.com/en/latest/retrievers/langchain.retrievers.document_compressors.chain_extract.NoOutputParser.html |
d3c837888886-2 | 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_none: bool = False, encoder: Optional[Cal... | https://api.python.langchain.com/en/latest/retrievers/langchain.retrievers.document_compressors.chain_extract.NoOutputParser.html |
d3c837888886-3 | Structured output.
parse_with_prompt(completion: str, prompt: PromptValue) → Any¶
Parse the output of an LLM call with the input prompt for context.
The prompt is largely provided in the event the OutputParser wants
to retry or fix the output in some way, and needs information from
the prompt to do so.
Parameters
compl... | https://api.python.langchain.com/en/latest/retrievers/langchain.retrievers.document_compressors.chain_extract.NoOutputParser.html |
d3c837888886-4 | eg. [“langchain”, “llms”, “openai”]
property lc_secrets: Dict[str, str]¶
Return a map of constructor argument names to secret ids.
eg. {“openai_api_key”: “OPENAI_API_KEY”}
property lc_serializable: bool¶
Return whether or not the class is serializable. | https://api.python.langchain.com/en/latest/retrievers/langchain.retrievers.document_compressors.chain_extract.NoOutputParser.html |
c90230b17223-0 | langchain.retrievers.chatgpt_plugin_retriever.ChatGPTPluginRetriever¶
class langchain.retrievers.chatgpt_plugin_retriever.ChatGPTPluginRetriever[source]¶
Bases: BaseRetriever
Retrieves documents from a ChatGPT plugin.
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError... | https://api.python.langchain.com/en/latest/retrievers/langchain.retrievers.chatgpt_plugin_retriever.ChatGPTPluginRetriever.html |
c90230b17223-1 | async aget_relevant_documents(query: str, *, callbacks: Callbacks = None, tags: Optional[List[str]] = None, metadata: Optional[Dict[str, Any]] = None, **kwargs: Any) → List[Document]¶
Asynchronously get documents relevant to a query.
:param query: string to find relevant documents for
:param callbacks: Callback manager... | https://api.python.langchain.com/en/latest/retrievers/langchain.retrievers.chatgpt_plugin_retriever.ChatGPTPluginRetriever.html |
c90230b17223-2 | 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.chatgpt_plugin_retriever.ChatGPTPluginRetriever.html |
c90230b17223-3 | 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 associated with each call to this retriever,
and passed as arguments to the handlers... | https://api.python.langchain.com/en/latest/retrievers/langchain.retrievers.chatgpt_plugin_retriever.ChatGPTPluginRetriever.html |
c90230b17223-4 | classmethod schema_json(*, by_alias: bool = True, ref_template: unicode = '#/definitions/{model}', **dumps_kwargs: Any) → unicode¶
stream(input: Input, config: Optional[RunnableConfig] = None) → Iterator[Output]¶
to_json() → Union[SerializedConstructor, SerializedNotImplemented]¶
to_json_not_implemented() → SerializedN... | https://api.python.langchain.com/en/latest/retrievers/langchain.retrievers.chatgpt_plugin_retriever.ChatGPTPluginRetriever.html |
f12097bd9e05-0 | langchain.retrievers.elastic_search_bm25.ElasticSearchBM25Retriever¶
class langchain.retrievers.elastic_search_bm25.ElasticSearchBM25Retriever[source]¶
Bases: BaseRetriever
Retriever for the Elasticsearch using BM25 as a retrieval method.
To connect to an Elasticsearch instance that requires login credentials,
includin... | https://api.python.langchain.com/en/latest/retrievers/langchain.retrievers.elastic_search_bm25.ElasticSearchBM25Retriever.html |
f12097bd9e05-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 tags: Optional[List[str]] = None¶
Optional list of tags associated with the retriever. Defaults to None
These tags will be associated with each call to this retrieve... | https://api.python.langchain.com/en/latest/retrievers/langchain.retrievers.elastic_search_bm25.ElasticSearchBM25Retriever.html |
f12097bd9e05-2 | and passed as arguments to the handlers defined in callbacks.
Returns
List of relevant documents
async ainvoke(input: str, config: Optional[RunnableConfig] = None) → List[Document]¶
async astream(input: Input, config: Optional[RunnableConfig] = None) → AsyncIterator[Output]¶
batch(inputs: List[Input], config: Optional[... | https://api.python.langchain.com/en/latest/retrievers/langchain.retrievers.elastic_search_bm25.ElasticSearchBM25Retriever.html |
f12097bd9e05-3 | deep – set to True to make a deep copy of the model
Returns
new model instance
classmethod create(elasticsearch_url: str, index_name: str, k1: float = 2.0, b: float = 0.75) → ElasticSearchBM25Retriever[source]¶
Create a ElasticSearchBM25Retriever from a list of texts.
Parameters
elasticsearch_url – URL of the Elasticse... | https://api.python.langchain.com/en/latest/retrievers/langchain.retrievers.elastic_search_bm25.ElasticSearchBM25Retriever.html |
f12097bd9e05-4 | 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]¶
json(*, include: Optional[Union[AbstractSetIntStr, MappingIntStrAny]] = None, ... | https://api.python.langchain.com/en/latest/retrievers/langchain.retrievers.elastic_search_bm25.ElasticSearchBM25Retriever.html |
f12097bd9e05-5 | to_json() → Union[SerializedConstructor, SerializedNotImplemented]¶
to_json_not_implemented() → SerializedNotImplemented¶
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_fallbacks(fallba... | https://api.python.langchain.com/en/latest/retrievers/langchain.retrievers.elastic_search_bm25.ElasticSearchBM25Retriever.html |
9a74534a31cd-0 | langchain.retrievers.bm25.BM25Retriever¶
class langchain.retrievers.bm25.BM25Retriever[source]¶
Bases: BaseRetriever
BM25 Retriever without elastic search.
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.
par... | https://api.python.langchain.com/en/latest/retrievers/langchain.retrievers.bm25.BM25Retriever.html |
9a74534a31cd-1 | async aget_relevant_documents(query: str, *, callbacks: Callbacks = None, tags: Optional[List[str]] = None, metadata: Optional[Dict[str, Any]] = None, **kwargs: Any) → List[Document]¶
Asynchronously get documents relevant to a query.
:param query: string to find relevant documents for
:param callbacks: Callback manager... | https://api.python.langchain.com/en/latest/retrievers/langchain.retrievers.bm25.BM25Retriever.html |
9a74534a31cd-2 | 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.bm25.BM25Retriever.html |
9a74534a31cd-3 | :param documents: A list of Documents to vectorize.
:param bm25_params: Parameters to pass to the BM25 vectorizer.
:param preprocess_func: A function to preprocess each text before vectorization.
:param **kwargs: Any other arguments to pass to the retriever.
Returns
A BM25Retriever instance.
classmethod from_orm(obj: A... | https://api.python.langchain.com/en/latest/retrievers/langchain.retrievers.bm25.BM25Retriever.html |
9a74534a31cd-4 | 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.retrievers.bm25.BM25Retriever.html |
9a74534a31cd-5 | stream(input: Input, config: Optional[RunnableConfig] = None) → Iterator[Output]¶
to_json() → Union[SerializedConstructor, SerializedNotImplemented]¶
to_json_not_implemented() → SerializedNotImplemented¶
classmethod update_forward_refs(**localns: Any) → None¶
Try to update ForwardRefs on fields based on this Model, glo... | https://api.python.langchain.com/en/latest/retrievers/langchain.retrievers.bm25.BM25Retriever.html |
f3456a0496ab-0 | langchain.retrievers.document_compressors.chain_extract.LLMChainExtractor¶
class langchain.retrievers.document_compressors.chain_extract.LLMChainExtractor[source]¶
Bases: BaseDocumentCompressor
DocumentCompressor that uses an LLM chain to extract
the relevant parts of documents.
Create a new model by parsing and valida... | https://api.python.langchain.com/en/latest/retrievers/langchain.retrievers.document_compressors.chain_extract.LLMChainExtractor.html |
f3456a0496ab-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 |
f3456a0496ab-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 |
f6694b9b59fc-0 | langchain.retrievers.knn.create_index¶
langchain.retrievers.knn.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. | https://api.python.langchain.com/en/latest/retrievers/langchain.retrievers.knn.create_index.html |
cea1bed3c630-0 | langchain.retrievers.self_query.myscale.FUNCTION_COMPOSER¶
langchain.retrievers.self_query.myscale.FUNCTION_COMPOSER(op_name: str) → Callable[source]¶
Composer for functions.
:param op_name: Name of the function.
Returns
Callable that takes a list of arguments and returns a string. | https://api.python.langchain.com/en/latest/retrievers/langchain.retrievers.self_query.myscale.FUNCTION_COMPOSER.html |
7a1b7e75f429-0 | langchain.retrievers.zep.ZepRetriever¶
class langchain.retrievers.zep.ZepRetriever[source]¶
Bases: BaseRetriever
Retriever for the Zep long-term memory store.
Search your user’s long-term chat history with Zep.
Note: You will need to provide the user’s session_id to use this retriever.
More on Zep:
Zep provides long-te... | https://api.python.langchain.com/en/latest/retrievers/langchain.retrievers.zep.ZepRetriever.html |
7a1b7e75f429-1 | param zep_client: Any = None¶
Zep client.
async abatch(inputs: List[Input], config: Optional[Union[RunnableConfig, List[RunnableConfig]]] = None, *, max_concurrency: Optional[int] = None) → List[Output]¶
async aget_relevant_documents(query: str, *, callbacks: Callbacks = None, tags: Optional[List[str]] = None, metadata... | https://api.python.langchain.com/en/latest/retrievers/langchain.retrievers.zep.ZepRetriever.html |
7a1b7e75f429-2 | 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.retrievers.zep.ZepRetriever.html |
7a1b7e75f429-3 | :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.retrievers.zep.ZepRetriever.html |
7a1b7e75f429-4 | classmethod schema_json(*, by_alias: bool = True, ref_template: unicode = '#/definitions/{model}', **dumps_kwargs: Any) → unicode¶
stream(input: Input, config: Optional[RunnableConfig] = None) → Iterator[Output]¶
to_json() → Union[SerializedConstructor, SerializedNotImplemented]¶
to_json_not_implemented() → SerializedN... | https://api.python.langchain.com/en/latest/retrievers/langchain.retrievers.zep.ZepRetriever.html |
0114848d0bcd-0 | langchain.retrievers.self_query.pinecone.PineconeTranslator¶
class langchain.retrievers.self_query.pinecone.PineconeTranslator[source]¶
Translate the 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.pinecone.PineconeTranslator.html |
21da176e4b68-0 | langchain.retrievers.self_query.qdrant.QdrantTranslator¶
class langchain.retrievers.self_query.qdrant.QdrantTranslator(metadata_key: str)[source]¶
Translate the internal query language elements to valid filters.
Attributes
allowed_comparators
Subset of allowed logical comparators.
allowed_operators
Methods
__init__(met... | https://api.python.langchain.com/en/latest/retrievers/langchain.retrievers.self_query.qdrant.QdrantTranslator.html |
0d8c6879b7b5-0 | langchain.retrievers.databerry.DataberryRetriever¶
class langchain.retrievers.databerry.DataberryRetriever[source]¶
Bases: BaseRetriever
Retriever for the Databerry API.
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 va... | https://api.python.langchain.com/en/latest/retrievers/langchain.retrievers.databerry.DataberryRetriever.html |
0d8c6879b7b5-1 | :param query: string to find relevant documents for
:param callbacks: Callback manager or list of callbacks
:param tags: Optional list of tags associated with the retriever. Defaults to None
These tags will be associated with each call to this retriever,
and passed as arguments to the handlers defined in callbacks.
Par... | https://api.python.langchain.com/en/latest/retrievers/langchain.retrievers.databerry.DataberryRetriever.html |
0d8c6879b7b5-2 | 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.databerry.DataberryRetriever.html |
0d8c6879b7b5-3 | 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_none: bool = False, encoder: Optional[Cal... | https://api.python.langchain.com/en/latest/retrievers/langchain.retrievers.databerry.DataberryRetriever.html |
0d8c6879b7b5-4 | classmethod validate(value: Any) → Model¶
with_fallbacks(fallbacks: ~typing.Sequence[~langchain.schema.runnable.Runnable[~langchain.schema.runnable.Input, ~langchain.schema.runnable.Output]], *, exceptions_to_handle: ~typing.Tuple[~typing.Type[BaseException]] = (<class 'Exception'>,)) → RunnableWithFallbacks[Input, Out... | https://api.python.langchain.com/en/latest/retrievers/langchain.retrievers.databerry.DataberryRetriever.html |
88b23c05916b-0 | langchain.retrievers.chaindesk.ChaindeskRetriever¶
class langchain.retrievers.chaindesk.ChaindeskRetriever[source]¶
Bases: BaseRetriever
Retriever for the Chaindesk API.
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 va... | https://api.python.langchain.com/en/latest/retrievers/langchain.retrievers.chaindesk.ChaindeskRetriever.html |
88b23c05916b-1 | :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.retrievers.chaindesk.ChaindeskRetriever.html |
88b23c05916b-2 | 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... | https://api.python.langchain.com/en/latest/retrievers/langchain.retrievers.chaindesk.ChaindeskRetriever.html |
88b23c05916b-3 | 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_none: bool = False, encoder: Optional[Cal... | https://api.python.langchain.com/en/latest/retrievers/langchain.retrievers.chaindesk.ChaindeskRetriever.html |
88b23c05916b-4 | classmethod validate(value: Any) → Model¶
with_fallbacks(fallbacks: ~typing.Sequence[~langchain.schema.runnable.Runnable[~langchain.schema.runnable.Input, ~langchain.schema.runnable.Output]], *, exceptions_to_handle: ~typing.Tuple[~typing.Type[BaseException]] = (<class 'Exception'>,)) → RunnableWithFallbacks[Input, Out... | https://api.python.langchain.com/en/latest/retrievers/langchain.retrievers.chaindesk.ChaindeskRetriever.html |
f3a885f07fb2-0 | langchain.retrievers.kendra.TextWithHighLights¶
class langchain.retrievers.kendra.TextWithHighLights[source]¶
Bases: BaseModel
Text with highlights.
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 High... | https://api.python.langchain.com/en/latest/retrievers/langchain.retrievers.kendra.TextWithHighLights.html |
f3a885f07fb2-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.retrievers.kendra.TextWithHighLights.html |
f3a885f07fb2-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.retrievers.kendra.TextWithHighLights.html |
56e668d953bc-0 | langchain.retrievers.web_research.QuestionListOutputParser¶
class langchain.retrievers.web_research.QuestionListOutputParser[source]¶
Bases: PydanticOutputParser
Output parser for a list of numbered questions.
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the ... | https://api.python.langchain.com/en/latest/retrievers/langchain.retrievers.web_research.QuestionListOutputParser.html |
56e668d953bc-1 | bind(**kwargs: Any) → Runnable[Input, Output]¶
Bind arguments to a Runnable, returning a new Runnable.
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 othe... | https://api.python.langchain.com/en/latest/retrievers/langchain.retrievers.web_research.QuestionListOutputParser.html |
56e668d953bc-2 | 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_none: bool = False, encoder: Optional[Cal... | https://api.python.langchain.com/en/latest/retrievers/langchain.retrievers.web_research.QuestionListOutputParser.html |
56e668d953bc-3 | Structured output.
parse_with_prompt(completion: str, prompt: PromptValue) → Any¶
Parse the output of an LLM call with the input prompt for context.
The prompt is largely provided in the event the OutputParser wants
to retry or fix the output in some way, and needs information from
the prompt to do so.
Parameters
compl... | https://api.python.langchain.com/en/latest/retrievers/langchain.retrievers.web_research.QuestionListOutputParser.html |
56e668d953bc-4 | eg. [“langchain”, “llms”, “openai”]
property lc_secrets: Dict[str, str]¶
Return a map of constructor argument names to secret ids.
eg. {“openai_api_key”: “OPENAI_API_KEY”}
property lc_serializable: bool¶
Return whether or not the class is serializable. | https://api.python.langchain.com/en/latest/retrievers/langchain.retrievers.web_research.QuestionListOutputParser.html |
8632fa07f2fd-0 | langchain.retrievers.kendra.AdditionalResultAttribute¶
class langchain.retrievers.kendra.AdditionalResultAttribute[source]¶
Bases: BaseModel
An additional result attribute.
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... | https://api.python.langchain.com/en/latest/retrievers/langchain.retrievers.kendra.AdditionalResultAttribute.html |
8632fa07f2fd-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.retrievers.kendra.AdditionalResultAttribute.html |
8632fa07f2fd-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.retrievers.kendra.AdditionalResultAttribute.html |
ee9578475b1f-0 | langchain_experimental.tot.controller.ToTController¶
class langchain_experimental.tot.controller.ToTController(c: int = 3)[source]¶
Tree of Thought (ToT) controller.
This is a version of a ToT controller, dubbed in the paper as a “Simple
Controller”.
It has one parameter c which is the number of children to explore for... | https://api.python.langchain.com/en/latest/tot/langchain_experimental.tot.controller.ToTController.html |
ae95a0089628-0 | langchain_experimental.tot.checker.ToTChecker¶
class langchain_experimental.tot.checker.ToTChecker[source]¶
Bases: Chain, ABC
Tree of Thought (ToT) checker.
This is an abstract ToT checker that must be implemented by the user. You
can implement a simple rule-based checker or a more sophisticated
neural network based cl... | https://api.python.langchain.com/en/latest/tot/langchain_experimental.tot.checker.ToTChecker.html |
ae95a0089628-1 | Optional list of tags associated with the chain. Defaults to None.
These tags will be associated with each call to this chain,
and passed as arguments to the handlers defined in callbacks.
You can use these to eg identify a specific instance of a chain with its use case.
param verbose: bool [Optional]¶
Whether or not r... | https://api.python.langchain.com/en/latest/tot/langchain_experimental.tot.checker.ToTChecker.html |
ae95a0089628-2 | to False.
Returns
A dict of named outputs. Should contain all outputs specified inChain.output_keys.
async abatch(inputs: List[Input], config: Optional[Union[RunnableConfig, List[RunnableConfig]]] = None, *, max_concurrency: Optional[int] = None) → List[Output]¶
async acall(inputs: Union[Dict[str, Any], Any], return_on... | https://api.python.langchain.com/en/latest/tot/langchain_experimental.tot.checker.ToTChecker.html |
ae95a0089628-3 | Returns
A dict of named outputs. Should contain all outputs specified inChain.output_keys.
async ainvoke(input: Dict[str, Any], config: Optional[RunnableConfig] = None) → Dict[str, Any]¶
apply(input_list: List[Dict[str, Any]], callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None) → List[Dic... | https://api.python.langchain.com/en/latest/tot/langchain_experimental.tot.checker.ToTChecker.html |
ae95a0089628-4 | # -> "The temperature in Boise is..."
# Suppose we have a multi-input chain that takes a 'question' string
# and 'context' string:
question = "What's the temperature in Boise, Idaho?"
context = "Weather report for Boise, Idaho on 07/03/23..."
await chain.arun(question=question, context=context)
# -> "The temperature in... | https://api.python.langchain.com/en/latest/tot/langchain_experimental.tot.checker.ToTChecker.html |
ae95a0089628-5 | 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(**kwargs: Any) → Dict¶
Dictionary representation of chain.
Expects Chain._chain_type property to be implemented and for memory to benull.
Parameters
**kwargs – Keyword arguments passed to defaul... | https://api.python.langchain.com/en/latest/tot/langchain_experimental.tot.checker.ToTChecker.html |
ae95a0089628-6 | 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¶
prep_inputs(inputs: Union[Dict[str, Any], Any]) → Dict[str, str]¶
Validate and prepare chain inputs, including ad... | https://api.python.langchain.com/en/latest/tot/langchain_experimental.tot.checker.ToTChecker.html |
ae95a0089628-7 | sole positional argument.
callbacks – Callbacks to use for this chain run. These will be called in
addition to callbacks passed to the chain during construction, but only
these runtime callbacks will propagate to calls to other objects.
tags – List of string tags to pass to all callbacks. These will be passed in
additi... | https://api.python.langchain.com/en/latest/tot/langchain_experimental.tot.checker.ToTChecker.html |
ae95a0089628-8 | to_json() → Union[SerializedConstructor, SerializedNotImplemented]¶
to_json_not_implemented() → SerializedNotImplemented¶
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_fallbacks(fallba... | https://api.python.langchain.com/en/latest/tot/langchain_experimental.tot.checker.ToTChecker.html |
d8000fa1d037-0 | langchain_experimental.tot.thought_generation.ProposePromptStrategy¶
class langchain_experimental.tot.thought_generation.ProposePromptStrategy[source]¶
Bases: BaseThoughtGenerationStrategy
Propose thoughts sequentially using a “propose prompt”.
This strategy works better when the thought space is more constrained, such... | https://api.python.langchain.com/en/latest/tot/langchain_experimental.tot.thought_generation.ProposePromptStrategy.html |
d8000fa1d037-1 | This metadata will be associated with each call to this chain,
and passed as arguments to the handlers defined in callbacks.
You can use these to eg identify a specific instance of a chain with its use case.
param output_key: str = 'text'¶
param output_parser: BaseLLMOutputParser [Optional]¶
Output parser to use.
Defau... | https://api.python.langchain.com/en/latest/tot/langchain_experimental.tot.thought_generation.ProposePromptStrategy.html |
d8000fa1d037-2 | Optional list of tags associated with the chain. Defaults to None.
These tags will be associated with each call to this chain,
and passed as arguments to the handlers defined in callbacks.
You can use these to eg identify a specific instance of a chain with its use case.
param tot_memory: Dict[Tuple[str, ...], List[str... | https://api.python.langchain.com/en/latest/tot/langchain_experimental.tot.thought_generation.ProposePromptStrategy.html |
d8000fa1d037-3 | metadata – Optional metadata associated with the chain. Defaults to None
include_run_info – Whether to include run info in the response. Defaults
to False.
Returns
A dict of named outputs. Should contain all outputs specified inChain.output_keys.
async aapply(input_list: List[Dict[str, Any]], callbacks: Optional[Union[... | https://api.python.langchain.com/en/latest/tot/langchain_experimental.tot.thought_generation.ProposePromptStrategy.html |
d8000fa1d037-4 | chain will be returned. Defaults to False.
callbacks – Callbacks to use for this chain run. These will be called in
addition to callbacks passed to the chain during construction, but only
these runtime callbacks will propagate to calls to other objects.
tags – List of string tags to pass to all callbacks. These will be... | https://api.python.langchain.com/en/latest/tot/langchain_experimental.tot.thought_generation.ProposePromptStrategy.html |
d8000fa1d037-5 | **kwargs – Keys to pass to prompt template.
Returns
Completion from LLM.
Example
completion = llm.predict(adjective="funny")
async apredict_and_parse(callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, **kwargs: Any) → Union[str, List[str], Dict[str, str]]¶
Call apredict and then parse th... | https://api.python.langchain.com/en/latest/tot/langchain_experimental.tot.thought_generation.ProposePromptStrategy.html |
d8000fa1d037-6 | directly as keyword arguments.
Returns
The chain output.
Example
# Suppose we have a single-input chain that takes a 'question' string:
await chain.arun("What's the temperature in Boise, Idaho?")
# -> "The temperature in Boise is..."
# Suppose we have a multi-input chain that takes a 'question' string
# and 'context' s... | https://api.python.langchain.com/en/latest/tot/langchain_experimental.tot.thought_generation.ProposePromptStrategy.html |
d8000fa1d037-7 | 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/tot/langchain_experimental.tot.thought_generation.ProposePromptStrategy.html |
d8000fa1d037-8 | 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_none: bool = False, encoder: Optional[Cal... | https://api.python.langchain.com/en/latest/tot/langchain_experimental.tot.thought_generation.ProposePromptStrategy.html |
d8000fa1d037-9 | Completion from LLM.
Example
completion = llm.predict(adjective="funny")
predict_and_parse(callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, **kwargs: Any) → Union[str, List[str], Dict[str, Any]]¶
Call predict and then parse the results.
prep_inputs(inputs: Union[Dict[str, Any], Any]) →... | https://api.python.langchain.com/en/latest/tot/langchain_experimental.tot.thought_generation.ProposePromptStrategy.html |
d8000fa1d037-10 | Convenience method for executing chain.
The main difference between this method and Chain.__call__ is that this
method expects inputs to be passed directly in as positional arguments or
keyword arguments, whereas Chain.__call__ expects a single input dictionary
with all the inputs
Parameters
*args – If the chain expect... | https://api.python.langchain.com/en/latest/tot/langchain_experimental.tot.thought_generation.ProposePromptStrategy.html |
d8000fa1d037-11 | Example
chain.save(file_path="path/chain.yaml")
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: Optiona... | https://api.python.langchain.com/en/latest/tot/langchain_experimental.tot.thought_generation.ProposePromptStrategy.html |
80ea08b6e7b3-0 | langchain_experimental.tot.base.ToTChain¶
class langchain_experimental.tot.base.ToTChain[source]¶
Bases: Chain
A Chain implementing the Tree of Thought (ToT).
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.
... | https://api.python.langchain.com/en/latest/tot/langchain_experimental.tot.base.ToTChain.html |
80ea08b6e7b3-1 | and passed as arguments to the handlers defined in callbacks.
You can use these to eg identify a specific instance of a chain with its use case.
param tags: Optional[List[str]] = None¶
Optional list of tags associated with the chain. Defaults to None.
These tags will be associated with each call to this chain,
and pass... | https://api.python.langchain.com/en/latest/tot/langchain_experimental.tot.base.ToTChain.html |
80ea08b6e7b3-2 | returned. If False, both input keys and new keys generated by this
chain will be returned. Defaults to False.
callbacks – Callbacks to use for this chain run. These will be called in
addition to callbacks passed to the chain during construction, but only
these runtime callbacks will propagate to calls to other objects.... | https://api.python.langchain.com/en/latest/tot/langchain_experimental.tot.base.ToTChain.html |
80ea08b6e7b3-3 | chain will be returned. Defaults to False.
callbacks – Callbacks to use for this chain run. These will be called in
addition to callbacks passed to the chain during construction, but only
these runtime callbacks will propagate to calls to other objects.
tags – List of string tags to pass to all callbacks. These will be... | https://api.python.langchain.com/en/latest/tot/langchain_experimental.tot.base.ToTChain.html |
80ea08b6e7b3-4 | addition to callbacks passed to the chain during construction, but only
these runtime callbacks will propagate to calls to other objects.
tags – List of string tags to pass to all callbacks. These will be passed in
addition to tags passed to the chain during construction, but only
these runtime tags will propagate to c... | https://api.python.langchain.com/en/latest/tot/langchain_experimental.tot.base.ToTChain.html |
80ea08b6e7b3-5 | 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/tot/langchain_experimental.tot.base.ToTChain.html |
80ea08b6e7b3-6 | 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_none: bool = False, encoder: Optional[Cal... | https://api.python.langchain.com/en/latest/tot/langchain_experimental.tot.base.ToTChain.html |
80ea08b6e7b3-7 | Returns
A dictionary of all inputs, including those added by the chain’s memory.
prep_outputs(inputs: Dict[str, str], outputs: Dict[str, str], return_only_outputs: bool = False) → Dict[str, str]¶
Validate and prepare chain outputs, and save info about this run to memory.
Parameters
inputs – Dictionary of chain inputs, ... | https://api.python.langchain.com/en/latest/tot/langchain_experimental.tot.base.ToTChain.html |
80ea08b6e7b3-8 | directly as keyword arguments.
Returns
The chain output.
Example
# Suppose we have a single-input chain that takes a 'question' string:
chain.run("What's the temperature in Boise, Idaho?")
# -> "The temperature in Boise is..."
# Suppose we have a multi-input chain that takes a 'question' string
# and 'context' string:
... | https://api.python.langchain.com/en/latest/tot/langchain_experimental.tot.base.ToTChain.html |
80ea08b6e7b3-9 | classmethod validate(value: Any) → Model¶
with_fallbacks(fallbacks: ~typing.Sequence[~langchain.schema.runnable.Runnable[~langchain.schema.runnable.Input, ~langchain.schema.runnable.Output]], *, exceptions_to_handle: ~typing.Tuple[~typing.Type[BaseException]] = (<class 'Exception'>,)) → RunnableWithFallbacks[Input, Out... | https://api.python.langchain.com/en/latest/tot/langchain_experimental.tot.base.ToTChain.html |
03a0f1a2dc69-0 | langchain_experimental.tot.thought.Thought¶
class langchain_experimental.tot.thought.Thought[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 children: Set[langchain_experiment... | https://api.python.langchain.com/en/latest/tot/langchain_experimental.tot.thought.Thought.html |
03a0f1a2dc69-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/tot/langchain_experimental.tot.thought.Thought.html |
03a0f1a2dc69-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/tot/langchain_experimental.tot.thought.Thought.html |
4c4f2e5a6fa5-0 | langchain_experimental.tot.thought_generation.BaseThoughtGenerationStrategy¶
class langchain_experimental.tot.thought_generation.BaseThoughtGenerationStrategy[source]¶
Bases: LLMChain
Base class for a thought generation strategy.
Create a new model by parsing and validating input data from keyword arguments.
Raises Val... | https://api.python.langchain.com/en/latest/tot/langchain_experimental.tot.thought_generation.BaseThoughtGenerationStrategy.html |
4c4f2e5a6fa5-1 | param output_parser: BaseLLMOutputParser [Optional]¶
Output parser to use.
Defaults to one that takes the most likely string but does not change it
otherwise.
param prompt: BasePromptTemplate [Required]¶
Prompt object to use.
param return_final_only: bool = True¶
Whether to return only the final parsed result. Defaults... | https://api.python.langchain.com/en/latest/tot/langchain_experimental.tot.thought_generation.BaseThoughtGenerationStrategy.html |
4c4f2e5a6fa5-2 | callbacks – Callbacks to use for this chain run. These will be called in
addition to callbacks passed to the chain during construction, but only
these runtime callbacks will propagate to calls to other objects.
tags – List of string tags to pass to all callbacks. These will be passed in
addition to tags passed to the c... | https://api.python.langchain.com/en/latest/tot/langchain_experimental.tot.thought_generation.BaseThoughtGenerationStrategy.html |
4c4f2e5a6fa5-3 | Parameters
inputs – Dictionary of inputs, or single input if chain expects
only one param. Should contain all inputs specified in
Chain.input_keys except for inputs that will be set by the chain’s
memory.
return_only_outputs – Whether to return only outputs in the
response. If True, only new keys generated by this chai... | https://api.python.langchain.com/en/latest/tot/langchain_experimental.tot.thought_generation.BaseThoughtGenerationStrategy.html |
4c4f2e5a6fa5-4 | Utilize the LLM generate method for speed gains.
apply_and_parse(input_list: List[Dict[str, Any]], callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None) → Sequence[Union[str, List[str], Dict[str, str]]]¶
Call apply and then parse the results.
async apredict(callbacks: Optional[Union[List[Ba... | https://api.python.langchain.com/en/latest/tot/langchain_experimental.tot.thought_generation.BaseThoughtGenerationStrategy.html |
4c4f2e5a6fa5-5 | sole positional argument.
callbacks – Callbacks to use for this chain run. These will be called in
addition to callbacks passed to the chain during construction, but only
these runtime callbacks will propagate to calls to other objects.
tags – List of string tags to pass to all callbacks. These will be passed in
additi... | https://api.python.langchain.com/en/latest/tot/langchain_experimental.tot.thought_generation.BaseThoughtGenerationStrategy.html |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.