id
stringlengths
14
16
text
stringlengths
4
1.28k
source
stringlengths
54
121
07ceff43f477-316
Return type Dict classmethod from_colored_object_prompt(llm, **kwargs)[source] Load PAL from colored object prompt. Parameters llm (langchain.base_language.BaseLanguageModel) – kwargs (Any) – Return type langchain.chains.pal.base.PALChain classmethod from_math_prompt(llm, **kwargs)[source] Load PAL from math prompt...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-317
inputs (Dict[str, str]) – outputs (Dict[str, str]) – return_only_outputs (bool) – Return type Dict[str, str] run(*args, callbacks=None, tags=None, **kwargs) Run the chain as text in, text out or multiple variables, text out. Parameters args (Any) – callbacks (Optional[Union[List[langchain.callbacks.base.BaseCallba...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-318
to_json() Return type Union[langchain.load.serializable.SerializedConstructor, langchain.load.serializable.SerializedNotImplemented] to_json_not_implemented() Return type langchain.load.serializable.SerializedNotImplemented property lc_attributes: Dict Return a list of attribute names that should be included in the ...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-319
class langchain.chains.QAGenerationChain(*, memory=None, callbacks=None, callback_manager=None, verbose=None, tags=None, llm_chain, text_splitter=<langchain.text_splitter.RecursiveCharacterTextSplitter object>, input_key='text', output_key='questions', k=None)[source] Bases: langchain.chains.base.Chain Parameters memo...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-320
output_key (str) – k (Optional[int]) – Return type None attribute callback_manager: Optional[BaseCallbackManager] = None Deprecated, use callbacks instead. attribute callbacks: Callbacks = None Optional list of callback handlers (or callback manager). Defaults to None. Callback handlers are called throughout the li...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-321
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. attribute output_key: str = 'questions' attribute tags: Optional[List[str]] = None...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-322
will be printed to the console. Defaults to langchain.verbose value. async acall(inputs, return_only_outputs=False, callbacks=None, *, tags=None, include_run_info=False) Run the logic of this chain and add to output if desired. Parameters inputs (Union[Dict[str, Any], Any]) – Dictionary of inputs, or single input if c...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-323
use the callbacks provided to the chain. include_run_info (bool) – Whether to include run info in the response. Defaults to False. tags (Optional[List[str]]) – Return type Dict[str, Any] apply(input_list, callbacks=None) Call the chain on all inputs in the list. Parameters input_list (List[Dict[str, Any]]) – callbac...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-324
tags (Optional[List[str]]) – kwargs (Any) – Return type str dict(**kwargs) Return dictionary representation of chain. Parameters kwargs (Any) – Return type Dict classmethod from_llm(llm, prompt=None, **kwargs)[source] Parameters llm (langchain.base_language.BaseLanguageModel) – prompt (Optional[langchain.prompts....
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-325
inputs (Dict[str, str]) – outputs (Dict[str, str]) – return_only_outputs (bool) – Return type Dict[str, str] run(*args, callbacks=None, tags=None, **kwargs) Run the chain as text in, text out or multiple variables, text out. Parameters args (Any) – callbacks (Optional[Union[List[langchain.callbacks.base.BaseCallba...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-326
to_json() Return type Union[langchain.load.serializable.SerializedConstructor, langchain.load.serializable.SerializedNotImplemented] to_json_not_implemented() Return type langchain.load.serializable.SerializedNotImplemented property input_keys: List[str] Input keys this chain expects. property lc_attributes: Dict R...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-327
property lc_serializable: bool Return whether or not the class is serializable. property output_keys: List[str] Output keys this chain expects. class langchain.chains.QAWithSourcesChain(*, memory=None, callbacks=None, callback_manager=None, verbose=None, tags=None, combine_documents_chain, question_key='question', in...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-328
tags (Optional[List[str]]) – combine_documents_chain (langchain.chains.combine_documents.base.BaseCombineDocumentsChain) – question_key (str) – input_docs_key (str) – answer_key (str) – sources_answer_key (str) – return_source_documents (bool) – Return type None attribute callback_manager: Optional[BaseCallbackM...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-329
Chain to use to combine documents. attribute 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....
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-330
attribute verbose: bool [Optional] Whether or not run in verbose mode. In verbose mode, some intermediate logs will be printed to the console. Defaults to langchain.verbose value. async acall(inputs, return_only_outputs=False, callbacks=None, *, tags=None, include_run_info=False) Run the logic of this chain and add t...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-331
chain will be returned. Defaults to False. callbacks (Optional[Union[List[langchain.callbacks.base.BaseCallbackHandler], langchain.callbacks.base.BaseCallbackManager]]) – Callbacks to use for this chain run. If not provided, will use the callbacks provided to the chain. include_run_info (bool) – Whether to include run ...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-332
Run the chain as text in, text out or multiple variables, text out. Parameters args (Any) – callbacks (Optional[Union[List[langchain.callbacks.base.BaseCallbackHandler], langchain.callbacks.base.BaseCallbackManager]]) – tags (Optional[List[str]]) – kwargs (Any) – Return type str dict(**kwargs) Return dictionary re...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-333
classmethod from_llm(llm, document_prompt=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=PromptTemplate(input_variables=['context', 'question']...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-334
just say that you don\'t know. Don\'t try to make up an answer.\nALWAYS return a "SOURCES" part in your answer.\n\nQUESTION: Which state/country\'s law governs the interpretation of the contract?\n=========\nContent: This Agreement is governed by English law and the parties submit to the exclusive jurisdiction of the E...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-335
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 between the parties.\n\n11.9 No Third-Party Beneficiar...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-336
Lady and Second Gentleman. Members of Congress and the Cabinet. Justices of the Supreme Court. My fellow Americans.  \n\nLast year COVID-19 kept us apart. This year we are finally together again. \n\nTonight, we meet as Democrats Republicans and Independents. But most importantly as Americans. \n\nWith a duty to one an...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-337
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 have lost so much to COVID-19. Time with one another. And...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-338
York City Police Department days after the funerals of Officer Wilbert Mora and his partner, Officer Jason Rivera. \n\nThey were responding to a 9-1-1 call when a man shot and killed them with a stolen gun. \n\nOfficer Mora was 27 years old. \n\nOfficer Rivera was 22. \n\nBoth Dominican Americans who’d grown up on the ...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-339
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 businesses and consumers. \n\nTonight, I can a...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-340
for patients and families. \n\nTo get there, I call on Congress to fund ARPA-H, the Advanced Research Projects Agency for Health. \n\nIt’s based on DARPA—the Defense Department project that led to the Internet, GPS, and so much more.  \n\nARPA-H will have a singular purpose—to drive breakthroughs in cancer, Alzheimer’s...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-341
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=========\nFINAL ANSWER: The president did not mention ...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-342
Construct the chain from an LLM. Parameters llm (langchain.base_language.BaseLanguageModel) – document_prompt (langchain.prompts.base.BasePromptTemplate) – question_prompt (langchain.prompts.base.BasePromptTemplate) – combine_prompt (langchain.prompts.base.BasePromptTemplate) – kwargs (Any) – Return type langchain...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-343
Return type Dict[str, str] run(*args, callbacks=None, tags=None, **kwargs) Run the chain as text in, text out or multiple variables, text out. Parameters args (Any) – callbacks (Optional[Union[List[langchain.callbacks.base.BaseCallbackHandler], langchain.callbacks.base.BaseCallbackManager]]) – tags (Optional[List[st...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-344
to_json_not_implemented() Return type langchain.load.serializable.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...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-345
class langchain.chains.RetrievalQA(*, memory=None, callbacks=None, callback_manager=None, verbose=None, tags=None, combine_documents_chain, input_key='query', output_key='result', return_source_documents=False, retriever)[source] Bases: langchain.chains.retrieval_qa.base.BaseRetrievalQA Chain for question-answering ag...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-346
callbacks (Optional[Union[List[langchain.callbacks.base.BaseCallbackHandler], langchain.callbacks.base.BaseCallbackManager]]) – callback_manager (Optional[langchain.callbacks.base.BaseCallbackManager]) – verbose (bool) – tags (Optional[List[str]]) – combine_documents_chain (langchain.chains.combine_documents.base.B...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-347
starting with on_chain_start, ending with on_chain_end or on_chain_error. Each custom chain can optionally call additional callback methods, see Callback docs for full details. attribute combine_documents_chain: BaseCombineDocumentsChain [Required] Chain to use to combine the documents. attribute memory: Optional[Base...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-348
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. attribute verbose: bool [Optional] Whether or no...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-349
returned. If False, both input keys and new keys generated by this chain will be returned. Defaults to False. callbacks (Optional[Union[List[langchain.callbacks.base.BaseCallbackHandler], langchain.callbacks.base.BaseCallbackManager]]) – Callbacks to use for this chain run. If not provided, will use the callbacks provi...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-350
List[Dict[str, str]] async arun(*args, callbacks=None, tags=None, **kwargs) Run the chain as text in, text out or multiple variables, text out. Parameters args (Any) – callbacks (Optional[Union[List[langchain.callbacks.base.BaseCallbackHandler], langchain.callbacks.base.BaseCallbackManager]]) – tags (Optional[List[s...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-351
kwargs (Any) – Return type langchain.chains.retrieval_qa.base.BaseRetrievalQA classmethod from_llm(llm, prompt=None, **kwargs) Initialize from LLM. Parameters llm (langchain.base_language.BaseLanguageModel) – prompt (Optional[langchain.prompts.prompt.PromptTemplate]) – kwargs (Any) – Return type langchain.chains.r...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-352
Return type Dict[str, str] run(*args, callbacks=None, tags=None, **kwargs) Run the chain as text in, text out or multiple variables, text out. Parameters args (Any) – callbacks (Optional[Union[List[langchain.callbacks.base.BaseCallbackHandler], langchain.callbacks.base.BaseCallbackManager]]) – tags (Optional[List[st...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-353
to_json_not_implemented() Return type langchain.load.serializable.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...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-354
class langchain.chains.RetrievalQAWithSourcesChain(*, memory=None, callbacks=None, callback_manager=None, verbose=None, tags=None, combine_documents_chain, question_key='question', input_docs_key='docs', answer_key='answer', sources_answer_key='sources', return_source_documents=False, retriever, reduce_k_below_max_toke...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-355
tags (Optional[List[str]]) – combine_documents_chain (langchain.chains.combine_documents.base.BaseCombineDocumentsChain) – question_key (str) – input_docs_key (str) – answer_key (str) – sources_answer_key (str) – return_source_documents (bool) – retriever (langchain.schema.BaseRetriever) – reduce_k_below_max_to...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-356
Each custom chain can optionally call additional callback methods, see Callback docs for full details. attribute combine_documents_chain: BaseCombineDocumentsChain [Required] Chain to use to combine documents. attribute max_tokens_limit: int = 3375 Restrict the docs to return from store based on tokens, enforced only...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-357
attribute retriever: langchain.schema.BaseRetriever [Required] Index to connect to. attribute return_source_documents: bool = False Return the source documents. attribute 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...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-358
Parameters inputs (Union[Dict[str, Any], Any]) – Dictionary of inputs, or single input if chain expects only one param. return_only_outputs (bool) – 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 generat...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-359
Parameters input_list (List[Dict[str, Any]]) – callbacks (Optional[Union[List[langchain.callbacks.base.BaseCallbackHandler], langchain.callbacks.base.BaseCallbackManager]]) – Return type List[Dict[str, str]] async arun(*args, callbacks=None, tags=None, **kwargs) Run the chain as text in, text out or multiple variabl...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-360
Load chain from chain type. Parameters llm (langchain.base_language.BaseLanguageModel) – chain_type (str) – chain_type_kwargs (Optional[dict]) – kwargs (Any) – Return type langchain.chains.qa_with_sources.base.BaseQAWithSourcesChain
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-361
classmethod from_llm(llm, document_prompt=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=PromptTemplate(input_variables=['context', 'question']...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-362
just say that you don\'t know. Don\'t try to make up an answer.\nALWAYS return a "SOURCES" part in your answer.\n\nQUESTION: Which state/country\'s law governs the interpretation of the contract?\n=========\nContent: This Agreement is governed by English law and the parties submit to the exclusive jurisdiction of the E...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-363
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 between the parties.\n\n11.9 No Third-Party Beneficiar...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-364
Lady and Second Gentleman. Members of Congress and the Cabinet. Justices of the Supreme Court. My fellow Americans.  \n\nLast year COVID-19 kept us apart. This year we are finally together again. \n\nTonight, we meet as Democrats Republicans and Independents. But most importantly as Americans. \n\nWith a duty to one an...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-365
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 have lost so much to COVID-19. Time with one another. And...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-366
York City Police Department days after the funerals of Officer Wilbert Mora and his partner, Officer Jason Rivera. \n\nThey were responding to a 9-1-1 call when a man shot and killed them with a stolen gun. \n\nOfficer Mora was 27 years old. \n\nOfficer Rivera was 22. \n\nBoth Dominican Americans who’d grown up on the ...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-367
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 businesses and consumers. \n\nTonight, I can a...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-368
for patients and families. \n\nTo get there, I call on Congress to fund ARPA-H, the Advanced Research Projects Agency for Health. \n\nIt’s based on DARPA—the Defense Department project that led to the Internet, GPS, and so much more.  \n\nARPA-H will have a singular purpose—to drive breakthroughs in cancer, Alzheimer’s...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-369
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=========\nFINAL ANSWER: The president did not mention ...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-370
Construct the chain from an LLM. Parameters llm (langchain.base_language.BaseLanguageModel) – document_prompt (langchain.prompts.base.BasePromptTemplate) – question_prompt (langchain.prompts.base.BasePromptTemplate) – combine_prompt (langchain.prompts.base.BasePromptTemplate) – kwargs (Any) – Return type langchain...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-371
Return type Dict[str, str] run(*args, callbacks=None, tags=None, **kwargs) Run the chain as text in, text out or multiple variables, text out. Parameters args (Any) – callbacks (Optional[Union[List[langchain.callbacks.base.BaseCallbackHandler], langchain.callbacks.base.BaseCallbackManager]]) – tags (Optional[List[st...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-372
to_json_not_implemented() Return type langchain.load.serializable.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...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-373
Chain that outputs the name of a destination chain and the inputs to it. Parameters memory (Optional[langchain.schema.BaseMemory]) – callbacks (Optional[Union[List[langchain.callbacks.base.BaseCallbackHandler], langchain.callbacks.base.BaseCallbackManager]]) – callback_manager (Optional[langchain.callbacks.base.BaseC...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-374
for full details. attribute 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 d...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-375
will be printed to the console. Defaults to langchain.verbose value. async acall(inputs, return_only_outputs=False, callbacks=None, *, tags=None, include_run_info=False) Run the logic of this chain and add to output if desired. Parameters inputs (Union[Dict[str, Any], Any]) – Dictionary of inputs, or single input if c...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-376
use the callbacks provided to the chain. include_run_info (bool) – Whether to include run info in the response. Defaults to False. tags (Optional[List[str]]) – Return type Dict[str, Any] apply(input_list, callbacks=None) Call the chain on all inputs in the list. Parameters input_list (List[Dict[str, Any]]) – callbac...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-377
langchain.chains.router.base.Route async arun(*args, callbacks=None, tags=None, **kwargs) Run the chain as text in, text out or multiple variables, text out. Parameters args (Any) – callbacks (Optional[Union[List[langchain.callbacks.base.BaseCallbackHandler], langchain.callbacks.base.BaseCallbackManager]]) – tags (O...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-378
inputs (Dict[str, str]) – outputs (Dict[str, str]) – return_only_outputs (bool) – Return type Dict[str, str] route(inputs, callbacks=None)[source] Parameters inputs (Dict[str, Any]) – callbacks (Optional[Union[List[langchain.callbacks.base.BaseCallbackHandler], langchain.callbacks.base.BaseCallbackManager]]) – Re...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-379
Save the chain. Parameters file_path (Union[pathlib.Path, str]) – Path to file to save the chain to. Return type None Example: .. code-block:: python chain.save(file_path=”path/chain.yaml”) to_json() Return type Union[langchain.load.serializable.SerializedConstructor, langchain.load.serializable.SerializedNotImplement...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-380
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. property output_keys: List[str] Output keys this chain expects. class langchain.chains.SQLDatabaseChai...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-381
db = SQLDatabase(...) db_chain = SQLDatabaseChain.from_llm(OpenAI(), db) Parameters memory (Optional[langchain.schema.BaseMemory]) – callbacks (Optional[Union[List[langchain.callbacks.base.BaseCallbackHandler], langchain.callbacks.base.BaseCallbackManager]]) – callback_manager (Optional[langchain.callbacks.base.BaseC...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-382
return_direct (bool) – use_query_checker (bool) – query_checker_prompt (Optional[langchain.prompts.base.BasePromptTemplate]) – Return type None attribute callback_manager: Optional[BaseCallbackManager] = None Deprecated, use callbacks instead. attribute callbacks: Callbacks = None Optional list of callback handler...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-383
attribute 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 ...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-384
attribute 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 its use case. attri...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-385
Run the logic of this chain and add to output if desired. Parameters inputs (Union[Dict[str, Any], Any]) – Dictionary of inputs, or single input if chain expects only one param. return_only_outputs (bool) – boolean for whether to return only outputs in the response. If True, only new keys generated by this chain will b...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-386
apply(input_list, callbacks=None) Call the chain on all inputs in the list. Parameters input_list (List[Dict[str, Any]]) – callbacks (Optional[Union[List[langchain.callbacks.base.BaseCallbackHandler], langchain.callbacks.base.BaseCallbackManager]]) – Return type List[Dict[str, str]] async arun(*args, callbacks=None,...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-387
Return type Dict classmethod from_llm(llm, db, prompt=None, **kwargs)[source] Parameters llm (langchain.base_language.BaseLanguageModel) – db (langchain.sql_database.SQLDatabase) – prompt (Optional[langchain.prompts.base.BasePromptTemplate]) – kwargs (Any) – Return type langchain.chains.sql_database.base.SQLDataba...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-388
Return type Dict[str, str] run(*args, callbacks=None, tags=None, **kwargs) Run the chain as text in, text out or multiple variables, text out. Parameters args (Any) – callbacks (Optional[Union[List[langchain.callbacks.base.BaseCallbackHandler], langchain.callbacks.base.BaseCallbackManager]]) – tags (Optional[List[st...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-389
to_json_not_implemented() Return type langchain.load.serializable.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...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-390
class langchain.chains.SQLDatabaseSequentialChain(*, memory=None, callbacks=None, callback_manager=None, verbose=None, tags=None, decider_chain, sql_chain, input_key='query', output_key='result', return_intermediate_steps=False)[source] Bases: langchain.chains.base.Chain Chain for querying SQL database that is a seque...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-391
verbose (bool) – tags (Optional[List[str]]) – decider_chain (langchain.chains.llm.LLMChain) – sql_chain (langchain.chains.sql_database.base.SQLDatabaseChain) – input_key (str) – output_key (str) – return_intermediate_steps (bool) – Return type None attribute callback_manager: Optional[BaseCallbackManager] = None...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-392
attribute 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 ...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-393
attribute verbose: bool [Optional] Whether or not run in verbose mode. In verbose mode, some intermediate logs will be printed to the console. Defaults to langchain.verbose value. async acall(inputs, return_only_outputs=False, callbacks=None, *, tags=None, include_run_info=False) Run the logic of this chain and add t...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-394
chain will be returned. Defaults to False. callbacks (Optional[Union[List[langchain.callbacks.base.BaseCallbackHandler], langchain.callbacks.base.BaseCallbackManager]]) – Callbacks to use for this chain run. If not provided, will use the callbacks provided to the chain. include_run_info (bool) – Whether to include run ...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-395
Run the chain as text in, text out or multiple variables, text out. Parameters args (Any) – callbacks (Optional[Union[List[langchain.callbacks.base.BaseCallbackHandler], langchain.callbacks.base.BaseCallbackManager]]) – tags (Optional[List[str]]) – kwargs (Any) – Return type str dict(**kwargs) Return dictionary re...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-396
classmethod from_llm(llm, database, query_prompt=PromptTemplate(input_variables=['input', 'table_info', 'dialect', 'top_k'], output_parser=None, partial_variables={}, template='Given an input question, first create a syntactically correct {dialect} query to run, then look at the results of the query and return the answ...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-397
is in which table.\n\nUse the following format:\n\nQuestion: Question here\nSQLQuery: SQL Query to run\nSQLResult: Result of the SQLQuery\nAnswer: Final answer here\n\nOnly use the following tables:\n{table_info}\n\nQuestion: {input}', template_format='f-string', validate_template=True), decider_prompt=PromptTemplate(i...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-398
Load the necessary chains. Parameters llm (langchain.base_language.BaseLanguageModel) – database (langchain.sql_database.SQLDatabase) – query_prompt (langchain.prompts.base.BasePromptTemplate) – decider_prompt (langchain.prompts.base.BasePromptTemplate) – kwargs (Any) – Return type langchain.chains.sql_database.ba...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-399
Return type Dict[str, str] run(*args, callbacks=None, tags=None, **kwargs) Run the chain as text in, text out or multiple variables, text out. Parameters args (Any) – callbacks (Optional[Union[List[langchain.callbacks.base.BaseCallbackHandler], langchain.callbacks.base.BaseCallbackManager]]) – tags (Optional[List[st...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-400
to_json_not_implemented() Return type langchain.load.serializable.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...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-401
Bases: langchain.chains.base.Chain Chain where the outputs of one chain feed directly into next. Parameters memory (Optional[langchain.schema.BaseMemory]) – callbacks (Optional[Union[List[langchain.callbacks.base.BaseCallbackHandler], langchain.callbacks.base.BaseCallbackManager]]) – callback_manager (Optional[langch...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-402
Callback handlers are called throughout the lifecycle of a call to a chain, starting with on_chain_start, ending with on_chain_end or on_chain_error. Each custom chain can optionally call additional callback methods, see Callback docs for full details. attribute chains: List[langchain.chains.base.Chain] [Required] att...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-403
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. attribute verbose: bool [Optional] Whether or no...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-404
returned. If False, both input keys and new keys generated by this chain will be returned. Defaults to False. callbacks (Optional[Union[List[langchain.callbacks.base.BaseCallbackHandler], langchain.callbacks.base.BaseCallbackManager]]) – Callbacks to use for this chain run. If not provided, will use the callbacks provi...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-405
List[Dict[str, str]] async arun(*args, callbacks=None, tags=None, **kwargs) Run the chain as text in, text out or multiple variables, text out. Parameters args (Any) – callbacks (Optional[Union[List[langchain.callbacks.base.BaseCallbackHandler], langchain.callbacks.base.BaseCallbackManager]]) – tags (Optional[List[s...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-406
inputs (Dict[str, str]) – outputs (Dict[str, str]) – return_only_outputs (bool) – Return type Dict[str, str] run(*args, callbacks=None, tags=None, **kwargs) Run the chain as text in, text out or multiple variables, text out. Parameters args (Any) – callbacks (Optional[Union[List[langchain.callbacks.base.BaseCallba...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-407
to_json() Return type Union[langchain.load.serializable.SerializedConstructor, langchain.load.serializable.SerializedNotImplemented] to_json_not_implemented() Return type langchain.load.serializable.SerializedNotImplemented property lc_attributes: Dict Return a list of attribute names that should be included in the ...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-408
class langchain.chains.SimpleSequentialChain(*, memory=None, callbacks=None, callback_manager=None, verbose=None, tags=None, chains, strip_outputs=False, input_key='input', output_key='output')[source] Bases: langchain.chains.base.Chain Simple chain where the outputs of one step feed directly into next. Parameters mem...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-409
Return type None attribute callback_manager: Optional[BaseCallbackManager] = None Deprecated, use callbacks instead. attribute callbacks: Callbacks = None Optional list of callback handlers (or callback manager). Defaults to None. Callback handlers are called throughout the lifecycle of a call to a chain, starting wi...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-410
There are many different types of memory - please see memory docs for the full catalog. attribute strip_outputs: bool = False attribute 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...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-411
Parameters inputs (Union[Dict[str, Any], Any]) – Dictionary of inputs, or single input if chain expects only one param. return_only_outputs (bool) – 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 generat...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-412
Parameters input_list (List[Dict[str, Any]]) – callbacks (Optional[Union[List[langchain.callbacks.base.BaseCallbackHandler], langchain.callbacks.base.BaseCallbackManager]]) – Return type List[Dict[str, str]] async arun(*args, callbacks=None, tags=None, **kwargs) Run the chain as text in, text out or multiple variabl...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-413
Return type Dict[str, str] prep_outputs(inputs, outputs, return_only_outputs=False) Validate and prep outputs. Parameters inputs (Dict[str, str]) – outputs (Dict[str, str]) – return_only_outputs (bool) – Return type Dict[str, str] run(*args, callbacks=None, tags=None, **kwargs) Run the chain as text in, text out o...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-414
Return type None Example: .. code-block:: python chain.save(file_path=”path/chain.yaml”) to_json() Return type Union[langchain.load.serializable.SerializedConstructor, langchain.load.serializable.SerializedNotImplemented] to_json_not_implemented() Return type langchain.load.serializable.SerializedNotImplemented prope...
https://api.python.langchain.com/en/latest/modules/chains.html
07ceff43f477-415
property lc_serializable: bool Return whether or not the class is serializable. class langchain.chains.TransformChain(*, memory=None, callbacks=None, callback_manager=None, verbose=None, tags=None, input_variables, output_variables, transform)[source] Bases: langchain.chains.base.Chain Chain transform chain output. E...
https://api.python.langchain.com/en/latest/modules/chains.html