id stringlengths 14 15 | text stringlengths 35 2.51k | source stringlengths 61 154 |
|---|---|---|
3ccc72295d09-6 | Raise deprecation warning if callback_manager is used.
run(*args: Any, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, tags: Optional[List[str]] = None, **kwargs: Any) → str¶
Run the chain as text in, text out or multiple variables, text out.
save(file_path: Union[Path, str]) → None¶
... | https://api.python.langchain.com/en/latest/chains/langchain.chains.llm_math.base.LLMMathChain.html |
6ce59b57c80b-0 | langchain.chains.query_constructor.ir.StructuredQuery¶
class langchain.chains.query_constructor.ir.StructuredQuery(*, query: str, filter: Optional[FilterDirective] = None, limit: Optional[int] = None)[source]¶
Bases: Expr
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationE... | https://api.python.langchain.com/en/latest/chains/langchain.chains.query_constructor.ir.StructuredQuery.html |
e7f5f381248c-0 | langchain.chains.router.multi_retrieval_qa.MultiRetrievalQAChain¶
class langchain.chains.router.multi_retrieval_qa.MultiRetrievalQAChain(*, memory: Optional[BaseMemory] = None, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, callback_manager: Optional[BaseCallbackManager] = None, verb... | https://api.python.langchain.com/en/latest/chains/langchain.chains.router.multi_retrieval_qa.MultiRetrievalQAChain.html |
e7f5f381248c-1 | and at the end of every chain. At the start, memory loads variables and passes
them along in the chain. At the end, it saves any returned variables.
There are many different types of memory - please see memory docs
for the full catalog.
param router_chain: LLMRouterChain [Required]¶
Chain for deciding a destination cha... | https://api.python.langchain.com/en/latest/chains/langchain.chains.router.multi_retrieval_qa.MultiRetrievalQAChain.html |
e7f5f381248c-2 | use the callbacks provided to the chain.
include_run_info – Whether to include run info in the response. Defaults
to False.
async acall(inputs: Union[Dict[str, Any], Any], return_only_outputs: bool = False, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, *, tags: Optional[List[str]] =... | https://api.python.langchain.com/en/latest/chains/langchain.chains.router.multi_retrieval_qa.MultiRetrievalQAChain.html |
e7f5f381248c-3 | dict(**kwargs: Any) → Dict¶
Return dictionary representation of chain.
classmethod from_retrievers(llm: BaseLanguageModel, retriever_infos: List[Dict[str, Any]], default_retriever: Optional[BaseRetriever] = None, default_prompt: Optional[PromptTemplate] = None, default_chain: Optional[Chain] = None, **kwargs: Any) → Mu... | https://api.python.langchain.com/en/latest/chains/langchain.chains.router.multi_retrieval_qa.MultiRetrievalQAChain.html |
e7f5f381248c-4 | constructor.
property lc_namespace: List[str]¶
Return the namespace of the langchain object.
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 t... | https://api.python.langchain.com/en/latest/chains/langchain.chains.router.multi_retrieval_qa.MultiRetrievalQAChain.html |
2c464d16bf3c-0 | langchain.chains.qa_with_sources.base.QAWithSourcesChain¶
class langchain.chains.qa_with_sources.base.QAWithSourcesChain(*, memory: Optional[BaseMemory] = None, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, callback_manager: Optional[BaseCallbackManager] = None, verbose: bool = None... | https://api.python.langchain.com/en/latest/chains/langchain.chains.qa_with_sources.base.QAWithSourcesChain.html |
2c464d16bf3c-1 | There are many different types of memory - please see memory docs
for the full catalog.
param return_source_documents: bool = False¶
Return the source documents.
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... | https://api.python.langchain.com/en/latest/chains/langchain.chains.qa_with_sources.base.QAWithSourcesChain.html |
2c464d16bf3c-2 | include_run_info – Whether to include run info in the response. Defaults
to False.
async acall(inputs: Union[Dict[str, Any], Any], return_only_outputs: bool = False, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, *, tags: Optional[List[str]] = None, include_run_info: bool = False) → ... | https://api.python.langchain.com/en/latest/chains/langchain.chains.qa_with_sources.base.QAWithSourcesChain.html |
2c464d16bf3c-3 | classmethod from_llm(llm: BaseLanguageModel, document_prompt: BasePromptTemplate = PromptTemplate(input_variables=['page_content', 'source'], output_parser=None, partial_variables={}, template='Content: {page_content}\nSource: {source}', template_format='f-string', validate_template=True), question_prompt: BasePromptTe... | https://api.python.langchain.com/en/latest/chains/langchain.chains.qa_with_sources.base.QAWithSourcesChain.html |
2c464d16bf3c-4 | or unenforceability of any term (or part of a term) of this Agreement shall not affect the continuation in force of the remainder of the term (if any) and this Agreement.\n\n11.8 No Agency. Except as expressly stated otherwise, nothing in this Agreement shall create an agency, partnership or joint venture of any kind... | https://api.python.langchain.com/en/latest/chains/langchain.chains.qa_with_sources.base.QAWithSourcesChain.html |
2c464d16bf3c-5 | \n\nFrom President Zelenskyy to every Ukrainian, their fearlessness, their courage, their determination, inspires the world. \n\nGroups of citizens blocking tanks with their bodies. Everyone from students to retirees teachers turned soldiers defending their homeland.\nSource: 0-pl\nContent: And we won’t stop. \n\nWe ha... | https://api.python.langchain.com/en/latest/chains/langchain.chains.qa_with_sources.base.QAWithSourcesChain.html |
2c464d16bf3c-6 | \n\nTo all Americans, I will be honest with you, as I’ve always promised. A Russian dictator, invading a foreign country, has costs around the world. \n\nAnd I’m taking robust action to make sure the pain of our sanctions is targeted at Russia’s economy. And I will use every tool at our disposal to protect American bu... | https://api.python.langchain.com/en/latest/chains/langchain.chains.qa_with_sources.base.QAWithSourcesChain.html |
2c464d16bf3c-7 | and most prosperous nation the world has ever known. \n\nNow is the hour. \n\nOur moment of responsibility. \n\nOur test of resolve and conscience, of history itself. \n\nIt is in this moment that our character is formed. Our purpose is found. Our future is forged. \n\nWell I know this nation.\nSource: 34-pl\n=========... | https://api.python.langchain.com/en/latest/chains/langchain.chains.qa_with_sources.base.QAWithSourcesChain.html |
2c464d16bf3c-8 | Construct the chain from an LLM.
prep_inputs(inputs: Union[Dict[str, Any], Any]) → Dict[str, str]¶
Validate and prep inputs.
prep_outputs(inputs: Dict[str, str], outputs: Dict[str, str], return_only_outputs: bool = False) → Dict[str, str]¶
Validate and prep outputs.
validator raise_deprecation » all fields¶
Raise dep... | https://api.python.langchain.com/en/latest/chains/langchain.chains.qa_with_sources.base.QAWithSourcesChain.html |
2c464d16bf3c-9 | 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.
model Config¶
Bases: object
Configuration for this pydantic object.
arbitrary_types_allowed = True¶
extra = 'forbid'¶ | https://api.python.langchain.com/en/latest/chains/langchain.chains.qa_with_sources.base.QAWithSourcesChain.html |
6e052b446aa9-0 | langchain.chains.query_constructor.ir.Operator¶
class langchain.chains.query_constructor.ir.Operator(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Bases: str, Enum
Enumerator of the operations.
Methods
__init__(*args, **kwds)
capitalize()
Return a capitalized version of t... | https://api.python.langchain.com/en/latest/chains/langchain.chains.query_constructor.ir.Operator.html |
6e052b446aa9-1 | Return True if the string is a decimal string, False otherwise.
isdigit()
Return True if the string is a digit string, False otherwise.
isidentifier()
Return True if the string is a valid Python identifier, False otherwise.
islower()
Return True if the string is a lowercase string, False otherwise.
isnumeric()
Return T... | https://api.python.langchain.com/en/latest/chains/langchain.chains.query_constructor.ir.Operator.html |
6e052b446aa9-2 | rjust(width[, fillchar])
Return a right-justified string of length width.
rpartition(sep, /)
Partition the string into three parts using the given separator.
rsplit([sep, maxsplit])
Return a list of the substrings in the string, using sep as the separator string.
rstrip([chars])
Return a copy of the string with trailin... | https://api.python.langchain.com/en/latest/chains/langchain.chains.query_constructor.ir.Operator.html |
6e052b446aa9-3 | Return the number of non-overlapping occurrences of substring sub in
string S[start:end]. Optional arguments start and end are
interpreted as in slice notation.
encode(encoding='utf-8', errors='strict')¶
Encode the string using the codec registered for encoding.
encodingThe encoding in which to encode the string.
erro... | https://api.python.langchain.com/en/latest/chains/langchain.chains.query_constructor.ir.Operator.html |
6e052b446aa9-4 | Return the lowest index in S where substring sub is found,
such that sub is contained within S[start:end]. Optional
arguments start and end are interpreted as in slice notation.
Raises ValueError when the substring is not found.
isalnum()¶
Return True if the string is an alpha-numeric string, False otherwise.
A string... | https://api.python.langchain.com/en/latest/chains/langchain.chains.query_constructor.ir.Operator.html |
6e052b446aa9-5 | isnumeric()¶
Return True if the string is a numeric string, False otherwise.
A string is numeric if all characters in the string are numeric and there is at
least one character in the string.
isprintable()¶
Return True if the string is printable, False otherwise.
A string is printable if all of its characters are consi... | https://api.python.langchain.com/en/latest/chains/langchain.chains.query_constructor.ir.Operator.html |
6e052b446aa9-6 | static maketrans()¶
Return a translation table usable for str.translate().
If there is only one argument, it must be a dictionary mapping Unicode
ordinals (integers) or characters to Unicode ordinals, strings or None.
Character keys will be then converted to ordinals.
If there are two arguments, they must be strings of... | https://api.python.langchain.com/en/latest/chains/langchain.chains.query_constructor.ir.Operator.html |
6e052b446aa9-7 | replaced.
rfind(sub[, start[, end]]) → int¶
Return the highest index in S where substring sub is found,
such that sub is contained within S[start:end]. Optional
arguments start and end are interpreted as in slice notation.
Return -1 on failure.
rindex(sub[, start[, end]]) → int¶
Return the highest index in S where sub... | https://api.python.langchain.com/en/latest/chains/langchain.chains.query_constructor.ir.Operator.html |
6e052b446aa9-8 | rstrip(chars=None, /)¶
Return a copy of the string with trailing whitespace removed.
If chars is given and not None, remove characters in chars instead.
split(sep=None, maxsplit=- 1)¶
Return a list of the substrings in the string, using sep as the separator string.
sepThe separator used to split the string.
When set to... | https://api.python.langchain.com/en/latest/chains/langchain.chains.query_constructor.ir.Operator.html |
6e052b446aa9-9 | translate(table, /)¶
Replace each character in the string using the given translation table.
tableTranslation table, which must be a mapping of Unicode ordinals to
Unicode ordinals, strings, or None.
The table must implement lookup/indexing via __getitem__, for instance a
dictionary or list. If this operation raises L... | https://api.python.langchain.com/en/latest/chains/langchain.chains.query_constructor.ir.Operator.html |
2a7a79231046-0 | langchain.chains.constitutional_ai.models.ConstitutionalPrinciple¶
class langchain.chains.constitutional_ai.models.ConstitutionalPrinciple(*, critique_request: str, revision_request: str, name: str = 'Constitutional Principle')[source]¶
Bases: BaseModel
Class for a constitutional principle.
Create a new model by parsin... | https://api.python.langchain.com/en/latest/chains/langchain.chains.constitutional_ai.models.ConstitutionalPrinciple.html |
81e7d57ddb2a-0 | langchain.chains.conversational_retrieval.base.BaseConversationalRetrievalChain¶
class langchain.chains.conversational_retrieval.base.BaseConversationalRetrievalChain(*, memory: Optional[BaseMemory] = None, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, callback_manager: Optional[Bas... | https://api.python.langchain.com/en/latest/chains/langchain.chains.conversational_retrieval.base.BaseConversationalRetrievalChain.html |
81e7d57ddb2a-1 | and at the end of every chain. At the start, memory loads variables and passes
them along in the chain. At the end, it saves any returned variables.
There are many different types of memory - please see memory docs
for the full catalog.
param output_key: str = 'answer'¶
param question_generator: LLMChain [Required]¶
pa... | https://api.python.langchain.com/en/latest/chains/langchain.chains.conversational_retrieval.base.BaseConversationalRetrievalChain.html |
81e7d57ddb2a-2 | include_run_info – Whether to include run info in the response. Defaults
to False.
async acall(inputs: Union[Dict[str, Any], Any], return_only_outputs: bool = False, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, *, tags: Optional[List[str]] = None, include_run_info: bool = False) → ... | https://api.python.langchain.com/en/latest/chains/langchain.chains.conversational_retrieval.base.BaseConversationalRetrievalChain.html |
81e7d57ddb2a-3 | Validate and prep inputs.
prep_outputs(inputs: Dict[str, str], outputs: Dict[str, str], return_only_outputs: bool = False) → Dict[str, str]¶
Validate and prep outputs.
validator raise_deprecation » all fields¶
Raise deprecation warning if callback_manager is used.
run(*args: Any, callbacks: Optional[Union[List[BaseCa... | https://api.python.langchain.com/en/latest/chains/langchain.chains.conversational_retrieval.base.BaseConversationalRetrievalChain.html |
81e7d57ddb2a-4 | model Config[source]¶
Bases: object
Configuration for this pydantic object.
allow_population_by_field_name = True¶
arbitrary_types_allowed = True¶
extra = 'forbid'¶ | https://api.python.langchain.com/en/latest/chains/langchain.chains.conversational_retrieval.base.BaseConversationalRetrievalChain.html |
17cec88fee61-0 | langchain.chains.openai_functions.citation_fuzzy_match.create_citation_fuzzy_match_chain¶
langchain.chains.openai_functions.citation_fuzzy_match.create_citation_fuzzy_match_chain(llm: BaseLanguageModel) → LLMChain[source]¶
Create a citation fuzzy match chain.
Parameters
llm – Language model to use for the chain.
Return... | https://api.python.langchain.com/en/latest/chains/langchain.chains.openai_functions.citation_fuzzy_match.create_citation_fuzzy_match_chain.html |
80c4fe326578-0 | langchain.chains.openai_functions.citation_fuzzy_match.QuestionAnswer¶
class langchain.chains.openai_functions.citation_fuzzy_match.QuestionAnswer(*, question: str, answer: List[FactWithEvidence])[source]¶
Bases: BaseModel
A question and its answer as a list of facts each one should have a source.
each sentence contain... | https://api.python.langchain.com/en/latest/chains/langchain.chains.openai_functions.citation_fuzzy_match.QuestionAnswer.html |
1bd3b0b31f6d-0 | langchain.chains.sequential.SimpleSequentialChain¶
class langchain.chains.sequential.SimpleSequentialChain(*, memory: Optional[BaseMemory] = None, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, callback_manager: Optional[BaseCallbackManager] = None, verbose: bool = None, tags: Option... | https://api.python.langchain.com/en/latest/chains/langchain.chains.sequential.SimpleSequentialChain.html |
1bd3b0b31f6d-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 ru... | https://api.python.langchain.com/en/latest/chains/langchain.chains.sequential.SimpleSequentialChain.html |
1bd3b0b31f6d-2 | Parameters
inputs – Dictionary of inputs, or single input if chain expects
only one param.
return_only_outputs – boolean for whether to return only outputs in the
response. If True, only new keys generated by this chain will be
returned. If False, both input keys and new keys generated by this
chain will be returned. D... | https://api.python.langchain.com/en/latest/chains/langchain.chains.sequential.SimpleSequentialChain.html |
1bd3b0b31f6d-3 | Run the chain as text in, text out or multiple variables, text out.
save(file_path: Union[Path, str]) → None¶
Save the chain.
Parameters
file_path – Path to file to save the chain to.
Example:
.. code-block:: python
chain.save(file_path=”path/chain.yaml”)
validator set_verbose » verbose¶
If verbose is None, set it.
T... | https://api.python.langchain.com/en/latest/chains/langchain.chains.sequential.SimpleSequentialChain.html |
b2959bbe81c7-0 | langchain.chains.conversational_retrieval.base.ChatVectorDBChain¶
class langchain.chains.conversational_retrieval.base.ChatVectorDBChain(*, memory: Optional[BaseMemory] = None, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, callback_manager: Optional[BaseCallbackManager] = None, verb... | https://api.python.langchain.com/en/latest/chains/langchain.chains.conversational_retrieval.base.ChatVectorDBChain.html |
b2959bbe81c7-1 | Optional memory object. Defaults to None.
Memory is a class that gets called at the start
and at the end of every chain. At the start, memory loads variables and passes
them along in the chain. At the end, it saves any returned variables.
There are many different types of memory - please see memory docs
for the full ca... | https://api.python.langchain.com/en/latest/chains/langchain.chains.conversational_retrieval.base.ChatVectorDBChain.html |
b2959bbe81c7-2 | response. If True, only new keys generated by this chain will be
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. If not provided, will
use the callbacks provided to the chain.
include_run_info – Whether to inc... | https://api.python.langchain.com/en/latest/chains/langchain.chains.conversational_retrieval.base.ChatVectorDBChain.html |
b2959bbe81c7-3 | Run the chain as text in, text out or multiple variables, text out.
dict(**kwargs: Any) → Dict¶
Return dictionary representation of chain.
classmethod from_llm(llm: BaseLanguageModel, vectorstore: VectorStore, condense_question_prompt: BasePromptTemplate = PromptTemplate(input_variables=['chat_history', 'question'], ou... | https://api.python.langchain.com/en/latest/chains/langchain.chains.conversational_retrieval.base.ChatVectorDBChain.html |
b2959bbe81c7-4 | Example:
.. code-block:: python
chain.save(file_path=”path/chain.yaml”)
validator set_verbose » verbose¶
If verbose is None, set it.
This allows users to pass in None as verbose to access the global setting.
to_json() → Union[SerializedConstructor, SerializedNotImplemented]¶
to_json_not_implemented() → SerializedNotI... | https://api.python.langchain.com/en/latest/chains/langchain.chains.conversational_retrieval.base.ChatVectorDBChain.html |
c2a6e8d53eb6-0 | langchain.chains.query_constructor.parser.get_parser¶
langchain.chains.query_constructor.parser.get_parser(allowed_comparators: Optional[Sequence[Comparator]] = None, allowed_operators: Optional[Sequence[Operator]] = None) → object[source]¶
Returns a parser for the query language.
Parameters
allowed_comparators – Optio... | https://api.python.langchain.com/en/latest/chains/langchain.chains.query_constructor.parser.get_parser.html |
27f022e1fa87-0 | langchain.chains.summarize.__init__.load_summarize_chain¶
langchain.chains.summarize.__init__.load_summarize_chain(llm: BaseLanguageModel, chain_type: str = 'stuff', verbose: Optional[bool] = None, **kwargs: Any) → BaseCombineDocumentsChain[source]¶
Load summarizing chain.
Parameters
llm – Language Model to use in the ... | https://api.python.langchain.com/en/latest/chains/langchain.chains.summarize.__init__.load_summarize_chain.html |
03144568e0f1-0 | langchain.chains.llm_bash.prompt.BashOutputParser¶
class langchain.chains.llm_bash.prompt.BashOutputParser[source]¶
Bases: BaseOutputParser
Parser for bash output.
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 mo... | https://api.python.langchain.com/en/latest/chains/langchain.chains.llm_bash.prompt.BashOutputParser.html |
03144568e0f1-1 | property lc_namespace: List[str]¶
Return the namespace of the langchain object.
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 s... | https://api.python.langchain.com/en/latest/chains/langchain.chains.llm_bash.prompt.BashOutputParser.html |
2c28bb957c32-0 | langchain.chains.moderation.OpenAIModerationChain¶
class langchain.chains.moderation.OpenAIModerationChain(*, memory: Optional[BaseMemory] = None, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, callback_manager: Optional[BaseCallbackManager] = None, verbose: bool = None, tags: Option... | https://api.python.langchain.com/en/latest/chains/langchain.chains.moderation.OpenAIModerationChain.html |
2c28bb957c32-1 | param memory: Optional[BaseMemory] = None¶
Optional memory object. Defaults to None.
Memory is a class that gets called at the start
and at the end of every chain. At the start, memory loads variables and passes
them along in the chain. At the end, it saves any returned variables.
There are many different types of memo... | https://api.python.langchain.com/en/latest/chains/langchain.chains.moderation.OpenAIModerationChain.html |
2c28bb957c32-2 | chain will be returned. Defaults to False.
callbacks – Callbacks to use for this chain run. If not provided, will
use the callbacks provided to the chain.
include_run_info – Whether to include run info in the response. Defaults
to False.
async acall(inputs: Union[Dict[str, Any], Any], return_only_outputs: bool = False,... | https://api.python.langchain.com/en/latest/chains/langchain.chains.moderation.OpenAIModerationChain.html |
2c28bb957c32-3 | dict(**kwargs: Any) → Dict¶
Return dictionary representation of chain.
prep_inputs(inputs: Union[Dict[str, Any], Any]) → Dict[str, str]¶
Validate and prep inputs.
prep_outputs(inputs: Dict[str, str], outputs: Dict[str, str], return_only_outputs: bool = False) → Dict[str, str]¶
Validate and prep outputs.
validator raise... | https://api.python.langchain.com/en/latest/chains/langchain.chains.moderation.OpenAIModerationChain.html |
2c28bb957c32-4 | 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.
model Config¶
Bases: object
Configuration for this pydantic object.
arbitrary_types_allowed = True¶ | https://api.python.langchain.com/en/latest/chains/langchain.chains.moderation.OpenAIModerationChain.html |
0d6f636e3391-0 | langchain.chains.query_constructor.ir.Comparison¶
class langchain.chains.query_constructor.ir.Comparison(*, comparator: Comparator, attribute: str, value: Any = None)[source]¶
Bases: FilterDirective
A comparison to a value.
Create a new model by parsing and validating input data from keyword arguments.
Raises Validatio... | https://api.python.langchain.com/en/latest/chains/langchain.chains.query_constructor.ir.Comparison.html |
a67922e4fcb1-0 | langchain.chains.mapreduce.MapReduceChain¶
class langchain.chains.mapreduce.MapReduceChain(*, memory: Optional[BaseMemory] = None, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, callback_manager: Optional[BaseCallbackManager] = None, verbose: bool = None, tags: Optional[List[str]] = ... | https://api.python.langchain.com/en/latest/chains/langchain.chains.mapreduce.MapReduceChain.html |
a67922e4fcb1-1 | 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 text_splitter: TextSplitter [Required]¶
Text splitter to use.
param verbose: bool [Optional]¶
Whether or not ... | https://api.python.langchain.com/en/latest/chains/langchain.chains.mapreduce.MapReduceChain.html |
a67922e4fcb1-2 | Parameters
inputs – Dictionary of inputs, or single input if chain expects
only one param.
return_only_outputs – boolean for whether to return only outputs in the
response. If True, only new keys generated by this chain will be
returned. If False, both input keys and new keys generated by this
chain will be returned. D... | https://api.python.langchain.com/en/latest/chains/langchain.chains.mapreduce.MapReduceChain.html |
a67922e4fcb1-3 | Validate and prep inputs.
prep_outputs(inputs: Dict[str, str], outputs: Dict[str, str], return_only_outputs: bool = False) → Dict[str, str]¶
Validate and prep outputs.
validator raise_deprecation » all fields¶
Raise deprecation warning if callback_manager is used.
run(*args: Any, callbacks: Optional[Union[List[BaseCa... | https://api.python.langchain.com/en/latest/chains/langchain.chains.mapreduce.MapReduceChain.html |
a67922e4fcb1-4 | Configuration for this pydantic object.
arbitrary_types_allowed = True¶
extra = 'forbid'¶ | https://api.python.langchain.com/en/latest/chains/langchain.chains.mapreduce.MapReduceChain.html |
1acfed0fbd42-0 | langchain.chains.hyde.base.HypotheticalDocumentEmbedder¶
class langchain.chains.hyde.base.HypotheticalDocumentEmbedder(*, memory: Optional[BaseMemory] = None, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, callback_manager: Optional[BaseCallbackManager] = None, verbose: bool = None, ... | https://api.python.langchain.com/en/latest/chains/langchain.chains.hyde.base.HypotheticalDocumentEmbedder.html |
1acfed0fbd42-1 | for the full catalog.
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 passed as arguments to the handlers defined in callbacks.
You can use these to eg identify a specific instance of a chain with i... | https://api.python.langchain.com/en/latest/chains/langchain.chains.hyde.base.HypotheticalDocumentEmbedder.html |
1acfed0fbd42-2 | Run the logic of this chain and add to output if desired.
Parameters
inputs – Dictionary of inputs, or single input if chain expects
only one param.
return_only_outputs – boolean for whether to return only outputs in the
response. If True, only new keys generated by this chain will be
returned. If False, both input key... | https://api.python.langchain.com/en/latest/chains/langchain.chains.hyde.base.HypotheticalDocumentEmbedder.html |
1acfed0fbd42-3 | Load and use LLMChain for a specific prompt key.
prep_inputs(inputs: Union[Dict[str, Any], Any]) → Dict[str, str]¶
Validate and prep inputs.
prep_outputs(inputs: Dict[str, str], outputs: Dict[str, str], return_only_outputs: bool = False) → Dict[str, str]¶
Validate and prep outputs.
validator raise_deprecation » all f... | https://api.python.langchain.com/en/latest/chains/langchain.chains.hyde.base.HypotheticalDocumentEmbedder.html |
1acfed0fbd42-4 | 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.
property output_keys: List[str]¶
Output keys for Hyde’s LLM chain.
model Config[source]¶
Bases: object
Configuration for this pydantic objec... | https://api.python.langchain.com/en/latest/chains/langchain.chains.hyde.base.HypotheticalDocumentEmbedder.html |
4a2b7d99d032-0 | langchain.chains.router.llm_router.RouterOutputParser¶
class langchain.chains.router.llm_router.RouterOutputParser(*, default_destination: str = 'DEFAULT', next_inputs_type: ~typing.Type = <class 'str'>, next_inputs_inner_key: str = 'input')[source]¶
Bases: BaseOutputParser[Dict[str, str]]
Parser for output of router c... | https://api.python.langchain.com/en/latest/chains/langchain.chains.router.llm_router.RouterOutputParser.html |
4a2b7d99d032-1 | to_json_not_implemented() → SerializedNotImplemented¶
property lc_attributes: Dict¶
Return a list of attribute names that should be included in the
serialized kwargs. These attributes must be accepted by the
constructor.
property lc_namespace: List[str]¶
Return the namespace of the langchain object.
eg. [“langchain”, “... | https://api.python.langchain.com/en/latest/chains/langchain.chains.router.llm_router.RouterOutputParser.html |
0da9bdb2f84d-0 | langchain.chains.openai_functions.tagging.create_tagging_chain_pydantic¶
langchain.chains.openai_functions.tagging.create_tagging_chain_pydantic(pydantic_schema: Any, llm: BaseLanguageModel) → Chain[source]¶
Creates a chain that extracts information from a passage.
Parameters
pydantic_schema – The pydantic schema of th... | https://api.python.langchain.com/en/latest/chains/langchain.chains.openai_functions.tagging.create_tagging_chain_pydantic.html |
e8783cab3381-0 | langchain.chains.sequential.SequentialChain¶
class langchain.chains.sequential.SequentialChain(*, memory: Optional[BaseMemory] = None, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, callback_manager: Optional[BaseCallbackManager] = None, verbose: bool = None, tags: Optional[List[str]... | https://api.python.langchain.com/en/latest/chains/langchain.chains.sequential.SequentialChain.html |
e8783cab3381-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 ru... | https://api.python.langchain.com/en/latest/chains/langchain.chains.sequential.SequentialChain.html |
e8783cab3381-2 | Parameters
inputs – Dictionary of inputs, or single input if chain expects
only one param.
return_only_outputs – boolean for whether to return only outputs in the
response. If True, only new keys generated by this chain will be
returned. If False, both input keys and new keys generated by this
chain will be returned. D... | https://api.python.langchain.com/en/latest/chains/langchain.chains.sequential.SequentialChain.html |
e8783cab3381-3 | Run the chain as text in, text out or multiple variables, text out.
save(file_path: Union[Path, str]) → None¶
Save the chain.
Parameters
file_path – Path to file to save the chain to.
Example:
.. code-block:: python
chain.save(file_path=”path/chain.yaml”)
validator set_verbose » verbose¶
If verbose is None, set it.
T... | https://api.python.langchain.com/en/latest/chains/langchain.chains.sequential.SequentialChain.html |
20a616660bd7-0 | langchain.chains.qa_with_sources.vector_db.VectorDBQAWithSourcesChain¶
class langchain.chains.qa_with_sources.vector_db.VectorDBQAWithSourcesChain(*, memory: Optional[BaseMemory] = None, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, callback_manager: Optional[BaseCallbackManager] = ... | https://api.python.langchain.com/en/latest/chains/langchain.chains.qa_with_sources.vector_db.VectorDBQAWithSourcesChain.html |
20a616660bd7-1 | Number of results to return from store
param max_tokens_limit: int = 3375¶
Restrict the docs to return from store based on tokens,
enforced only for StuffDocumentChain and if reduce_k_below_max_tokens is to true
param memory: Optional[BaseMemory] = None¶
Optional memory object. Defaults to None.
Memory is a class that ... | https://api.python.langchain.com/en/latest/chains/langchain.chains.qa_with_sources.vector_db.VectorDBQAWithSourcesChain.html |
20a616660bd7-2 | Run the logic of this chain and add to output if desired.
Parameters
inputs – Dictionary of inputs, or single input if chain expects
only one param.
return_only_outputs – boolean for whether to return only outputs in the
response. If True, only new keys generated by this chain will be
returned. If False, both input key... | https://api.python.langchain.com/en/latest/chains/langchain.chains.qa_with_sources.vector_db.VectorDBQAWithSourcesChain.html |
20a616660bd7-3 | Call the chain on all inputs in the list.
async arun(*args: Any, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, tags: Optional[List[str]] = None, **kwargs: Any) → str¶
Run the chain as text in, text out or multiple variables, text out.
dict(**kwargs: Any) → Dict¶
Return dictionary re... | https://api.python.langchain.com/en/latest/chains/langchain.chains.qa_with_sources.vector_db.VectorDBQAWithSourcesChain.html |
20a616660bd7-4 | classmethod from_llm(llm: BaseLanguageModel, document_prompt: BasePromptTemplate = PromptTemplate(input_variables=['page_content', 'source'], output_parser=None, partial_variables={}, template='Content: {page_content}\nSource: {source}', template_format='f-string', validate_template=True), question_prompt: BasePromptTe... | https://api.python.langchain.com/en/latest/chains/langchain.chains.qa_with_sources.vector_db.VectorDBQAWithSourcesChain.html |
20a616660bd7-5 | or unenforceability of any term (or part of a term) of this Agreement shall not affect the continuation in force of the remainder of the term (if any) and this Agreement.\n\n11.8 No Agency. Except as expressly stated otherwise, nothing in this Agreement shall create an agency, partnership or joint venture of any kind... | https://api.python.langchain.com/en/latest/chains/langchain.chains.qa_with_sources.vector_db.VectorDBQAWithSourcesChain.html |
20a616660bd7-6 | \n\nFrom President Zelenskyy to every Ukrainian, their fearlessness, their courage, their determination, inspires the world. \n\nGroups of citizens blocking tanks with their bodies. Everyone from students to retirees teachers turned soldiers defending their homeland.\nSource: 0-pl\nContent: And we won’t stop. \n\nWe ha... | https://api.python.langchain.com/en/latest/chains/langchain.chains.qa_with_sources.vector_db.VectorDBQAWithSourcesChain.html |
20a616660bd7-7 | \n\nTo all Americans, I will be honest with you, as I’ve always promised. A Russian dictator, invading a foreign country, has costs around the world. \n\nAnd I’m taking robust action to make sure the pain of our sanctions is targeted at Russia’s economy. And I will use every tool at our disposal to protect American bu... | https://api.python.langchain.com/en/latest/chains/langchain.chains.qa_with_sources.vector_db.VectorDBQAWithSourcesChain.html |
20a616660bd7-8 | and most prosperous nation the world has ever known. \n\nNow is the hour. \n\nOur moment of responsibility. \n\nOur test of resolve and conscience, of history itself. \n\nIt is in this moment that our character is formed. Our purpose is found. Our future is forged. \n\nWell I know this nation.\nSource: 34-pl\n=========... | https://api.python.langchain.com/en/latest/chains/langchain.chains.qa_with_sources.vector_db.VectorDBQAWithSourcesChain.html |
20a616660bd7-9 | Construct the chain from an LLM.
prep_inputs(inputs: Union[Dict[str, Any], Any]) → Dict[str, str]¶
Validate and prep inputs.
prep_outputs(inputs: Dict[str, str], outputs: Dict[str, str], return_only_outputs: bool = False) → Dict[str, str]¶
Validate and prep outputs.
validator raise_deprecation » all fields[source]¶
R... | https://api.python.langchain.com/en/latest/chains/langchain.chains.qa_with_sources.vector_db.VectorDBQAWithSourcesChain.html |
20a616660bd7-10 | 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.
model Config¶
Bases: object
Configuration for this pydantic object.
arbitrary_types_allowed = True¶
extra = 'forbid'¶ | https://api.python.langchain.com/en/latest/chains/langchain.chains.qa_with_sources.vector_db.VectorDBQAWithSourcesChain.html |
1d4aaf93421b-0 | langchain.chains.flare.prompts.FinishedOutputParser¶
class langchain.chains.flare.prompts.FinishedOutputParser(*, finished_value: str = 'FINISHED')[source]¶
Bases: BaseOutputParser[Tuple[str, bool]]
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data ... | https://api.python.langchain.com/en/latest/chains/langchain.chains.flare.prompts.FinishedOutputParser.html |
1d4aaf93421b-1 | 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.
model Config¶
Bases: object
extra = 'ignore'¶ | https://api.python.langchain.com/en/latest/chains/langchain.chains.flare.prompts.FinishedOutputParser.html |
fb5fa55b052a-0 | langchain.chains.prompt_selector.is_llm¶
langchain.chains.prompt_selector.is_llm(llm: BaseLanguageModel) → bool[source]¶
Check if the language model is a LLM.
Parameters
llm – Language model to check.
Returns
True if the language model is a BaseLLM model, False otherwise. | https://api.python.langchain.com/en/latest/chains/langchain.chains.prompt_selector.is_llm.html |
be51d53db29a-0 | langchain.chains.loading.load_chain_from_config¶
langchain.chains.loading.load_chain_from_config(config: dict, **kwargs: Any) → Chain[source]¶
Load chain from Config Dict. | https://api.python.langchain.com/en/latest/chains/langchain.chains.loading.load_chain_from_config.html |
c4325a8243eb-0 | langchain.chains.query_constructor.ir.Comparator¶
class langchain.chains.query_constructor.ir.Comparator(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)[source]¶
Bases: str, Enum
Enumerator of the comparison operators.
Methods
__init__(*args, **kwds)
capitalize()
Return a capitalize... | https://api.python.langchain.com/en/latest/chains/langchain.chains.query_constructor.ir.Comparator.html |
c4325a8243eb-1 | Return True if the string is a decimal string, False otherwise.
isdigit()
Return True if the string is a digit string, False otherwise.
isidentifier()
Return True if the string is a valid Python identifier, False otherwise.
islower()
Return True if the string is a lowercase string, False otherwise.
isnumeric()
Return T... | https://api.python.langchain.com/en/latest/chains/langchain.chains.query_constructor.ir.Comparator.html |
c4325a8243eb-2 | rjust(width[, fillchar])
Return a right-justified string of length width.
rpartition(sep, /)
Partition the string into three parts using the given separator.
rsplit([sep, maxsplit])
Return a list of the substrings in the string, using sep as the separator string.
rstrip([chars])
Return a copy of the string with trailin... | https://api.python.langchain.com/en/latest/chains/langchain.chains.query_constructor.ir.Comparator.html |
c4325a8243eb-3 | Return the number of non-overlapping occurrences of substring sub in
string S[start:end]. Optional arguments start and end are
interpreted as in slice notation.
encode(encoding='utf-8', errors='strict')¶
Encode the string using the codec registered for encoding.
encodingThe encoding in which to encode the string.
erro... | https://api.python.langchain.com/en/latest/chains/langchain.chains.query_constructor.ir.Comparator.html |
c4325a8243eb-4 | Return the lowest index in S where substring sub is found,
such that sub is contained within S[start:end]. Optional
arguments start and end are interpreted as in slice notation.
Raises ValueError when the substring is not found.
isalnum()¶
Return True if the string is an alpha-numeric string, False otherwise.
A string... | https://api.python.langchain.com/en/latest/chains/langchain.chains.query_constructor.ir.Comparator.html |
c4325a8243eb-5 | isnumeric()¶
Return True if the string is a numeric string, False otherwise.
A string is numeric if all characters in the string are numeric and there is at
least one character in the string.
isprintable()¶
Return True if the string is printable, False otherwise.
A string is printable if all of its characters are consi... | https://api.python.langchain.com/en/latest/chains/langchain.chains.query_constructor.ir.Comparator.html |
c4325a8243eb-6 | static maketrans()¶
Return a translation table usable for str.translate().
If there is only one argument, it must be a dictionary mapping Unicode
ordinals (integers) or characters to Unicode ordinals, strings or None.
Character keys will be then converted to ordinals.
If there are two arguments, they must be strings of... | https://api.python.langchain.com/en/latest/chains/langchain.chains.query_constructor.ir.Comparator.html |
c4325a8243eb-7 | replaced.
rfind(sub[, start[, end]]) → int¶
Return the highest index in S where substring sub is found,
such that sub is contained within S[start:end]. Optional
arguments start and end are interpreted as in slice notation.
Return -1 on failure.
rindex(sub[, start[, end]]) → int¶
Return the highest index in S where sub... | https://api.python.langchain.com/en/latest/chains/langchain.chains.query_constructor.ir.Comparator.html |
c4325a8243eb-8 | rstrip(chars=None, /)¶
Return a copy of the string with trailing whitespace removed.
If chars is given and not None, remove characters in chars instead.
split(sep=None, maxsplit=- 1)¶
Return a list of the substrings in the string, using sep as the separator string.
sepThe separator used to split the string.
When set to... | https://api.python.langchain.com/en/latest/chains/langchain.chains.query_constructor.ir.Comparator.html |
c4325a8243eb-9 | translate(table, /)¶
Replace each character in the string using the given translation table.
tableTranslation table, which must be a mapping of Unicode ordinals to
Unicode ordinals, strings, or None.
The table must implement lookup/indexing via __getitem__, for instance a
dictionary or list. If this operation raises L... | https://api.python.langchain.com/en/latest/chains/langchain.chains.query_constructor.ir.Comparator.html |
b0744d6ee3b7-0 | langchain.chains.conversational_retrieval.base.ConversationalRetrievalChain¶
class langchain.chains.conversational_retrieval.base.ConversationalRetrievalChain(*, memory: Optional[BaseMemory] = None, callbacks: Optional[Union[List[BaseCallbackHandler], BaseCallbackManager]] = None, callback_manager: Optional[BaseCallbac... | https://api.python.langchain.com/en/latest/chains/langchain.chains.conversational_retrieval.base.ConversationalRetrievalChain.html |
b0744d6ee3b7-1 | If set, restricts the docs to return from store based on tokens, enforced only
for StuffDocumentChain
param memory: Optional[BaseMemory] = None¶
Optional memory object. Defaults to None.
Memory is a class that gets called at the start
and at the end of every chain. At the start, memory loads variables and passes
them a... | https://api.python.langchain.com/en/latest/chains/langchain.chains.conversational_retrieval.base.ConversationalRetrievalChain.html |
b0744d6ee3b7-2 | only one param.
return_only_outputs – boolean for whether to return only outputs in the
response. If True, only new keys generated by this chain will be
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. If not p... | https://api.python.langchain.com/en/latest/chains/langchain.chains.conversational_retrieval.base.ConversationalRetrievalChain.html |
b0744d6ee3b7-3 | Run the chain as text in, text out or multiple variables, text out.
dict(**kwargs: Any) → Dict¶
Return dictionary representation of chain.
classmethod from_llm(llm: BaseLanguageModel, retriever: BaseRetriever, condense_question_prompt: BasePromptTemplate = PromptTemplate(input_variables=['chat_history', 'question'], ou... | https://api.python.langchain.com/en/latest/chains/langchain.chains.conversational_retrieval.base.ConversationalRetrievalChain.html |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.