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-classicchainsbaseChainprep_outputs
    Methodā—Since v1.0

    prep_outputs

    Copy
    prep_outputs(
      self,
      inputs: dict[str, str],
      outputs: dict[str
    View source on GitHub
    ,
    str
    ]
    ,
    return_only_outputs
    :
    bool
    =
    False
    )
    ->
    dict
    [
    str
    ,
    str
    ]

    Parameters

    NameTypeDescription
    inputs*dict[str, str]

    Dictionary of chain inputs, including any inputs added by chain memory.

    outputs*dict[str, str]

    Dictionary of initial chain outputs.

    return_only_outputsbool
    Default:False

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

    Whether to only return the chain outputs. If False, inputs are also added to the final outputs.