LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
  • MCP Adapters
    Standard Tests
    Text Splitters
    • Overview
    • Agents
    • Callbacks
    • Chains
    • Chat models
    • Embeddings
    • Evaluation
    • Globals
    • Hub
    • Memory
    • Output parsers
    • Retrievers
    • Runnables
    • LangSmith
    • Storage
    ⌘I

    LangChain Assistant

    Ask a question to get started

    Enter to send•Shift+Enter new line

    Menu

    MCP Adapters
    Standard Tests
    Text Splitters
    OverviewAgentsCallbacksChainsChat modelsEmbeddingsEvaluationGlobalsHubMemoryOutput parsersRetrieversRunnablesLangSmithStorage
    Language
    Theme
    Pythonlangchain-classicevaluationqagenerate_chainQAGenerateChain
    Class●Since v1.0

    QAGenerateChain

    Copy
    QAGenerateChain()

    Bases

    LLMChain

    Attributes

    Methods

    Inherited fromLLMChain

    Attributes

    Aprompt: BasePromptTemplate
    —

    Prompt object to use.

    Allm: Runnable[LanguageModelInput, str] | Runnable[LanguageModelInput, BaseMessage]
    —

    Language model to call.

    Areturn_final_only: bool
    —

    Whether to return only the final parsed result.

    View source on GitHub
    A
    llm_kwargs
    : dict
    Amodel_config
    Ainput_keys: list[str]
    —

    Will be whatever keys the prompt expects.

    Aoutput_keys: list[str]
    —

    Will always return text key.

    Methods

    Mgenerate
    —

    Generate LLM result from inputs.

    Magenerate
    —

    Generate LLM result from inputs.

    Mprep_prompts
    —

    Prepare prompts from inputs.

    Maprep_prompts
    —

    Prepare prompts from inputs.

    Mapply
    —

    Utilize the LLM generate method for speed gains.

    Maapply
    —

    Utilize the LLM generate method for speed gains.

    Mcreate_outputs
    —

    Create outputs from response.

    Mpredict
    —

    Format prompt with kwargs and pass to LLM.

    Mapredict
    —

    Format prompt with kwargs and pass to LLM.

    Mpredict_and_parse
    —

    Call predict and then parse the results.

    Mapredict_and_parse
    —

    Call apredict and then parse the results.

    Mapply_and_parse
    —

    Call apply and then parse the results.

    Maapply_and_parse
    —

    Call apply and then parse the results.

    Mfrom_string
    —

    Create LLMChain from LLM and template.

    Inherited fromChain

    Attributes

    Amemory: BaseMemory | None
    —

    Optional memory object.

    Acallbacks: Callbacks
    —

    Optional list of callback handlers (or callback manager).

    Averbose: bool
    —

    Whether or not run in verbose mode. In verbose mode, some intermediate logs

    Atags: list[str] | None
    —

    Optional list of tags associated with the chain.

    Ametadata: builtins.dict[str, Any] | None
    —

    Optional metadata associated with the chain.

    Acallback_manager: BaseCallbackManager | None
    —

    [DEPRECATED] Use callbacks instead.

    Amodel_configAinput_keys: list[str]
    —

    Keys expected to be in the chain input.

    Aoutput_keys: list[str]
    —

    Keys expected to be in the chain output.

    Methods

    Mget_input_schemaMget_output_schemaMinvokeMainvokeMraise_callback_manager_deprecation
    —

    Raise deprecation warning if callback_manager is used.

    M

    Inherited fromRunnableSerializable(langchain_core)

    Attributes

    AnameAmodel_config

    Methods

    Mto_jsonMconfigurable_fieldsMconfigurable_alternatives

    Inherited fromSerializable(langchain_core)

    Attributes

    Alc_secretsAlc_attributesAmodel_config

    Methods

    Mget_lc_namespaceMlc_idMto_jsonMto_json_not_implemented

    Inherited fromRunnable(langchain_core)

    Attributes

    AnameAInputTypeAOutputTypeAinput_schemaAoutput_schemaAconfig_specs

    Methods

    Mget_nameMget_input_schemaMget_input_jsonschemaMget_output_schemaMget_output_jsonschemaMconfig_schema
    attribute
    output_parser: BaseLLMOutputParser
    attribute
    output_key: str
    method
    is_lc_serializable
    method
    from_llm

    Load QA Generate Chain from LLM.

    LLM Chain for generating examples for question answering.

    set_verbose
    —

    Set the chain verbosity.

    Macall
    —

    Asynchronously execute the chain.

    Mprep_outputs
    —

    Validate and prepare chain outputs, and save info about this run to memory.

    Maprep_outputs
    —

    Validate and prepare chain outputs, and save info about this run to memory.

    Mprep_inputs
    —

    Prepare chain inputs, including adding inputs from memory.

    Maprep_inputs
    —

    Prepare chain inputs, including adding inputs from memory.

    Mrun
    —

    Convenience method for executing chain.

    Marun
    —

    Convenience method for executing chain.

    Mdict
    —

    Dictionary representation of chain.

    Msave
    —

    Save the chain.

    Mapply
    —

    Call the chain on all inputs in the list.

    M
    get_config_jsonschema
    Mget_graph
    Mget_prompts
    Mpipe
    Mpick
    Massign
    Minvoke
    Mainvoke
    Mbatch
    Mbatch_as_completed
    Mabatch
    Mabatch_as_completed
    Mstream
    Mastream
    Mastream_log
    Mastream_events
    Mtransform
    Matransform
    Mbind
    Mwith_config
    Mwith_listeners
    Mwith_alisteners
    Mwith_types
    Mwith_retry
    Mmap
    Mwith_fallbacks
    Mas_tool