LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
    • Overview
    • Graphs
    • Functional API
    • Pregel
    • Checkpointing
    • Storage
    • Caching
    • Types
    • Runtime
    • Config
    • Errors
    • Constants
    • Channels
    • Agents
    LangGraph Checkpoint
    LangGraph Store
    Checkpoint Postgres
    Store Postgres
    Checkpoint SQLite
    LangGraph Prebuilt
    LangGraph CLI
    LangGraph SDK
    LangGraph Supervisor
    LangGraph Swarm
    ⌘I

    LangChain Assistant

    Ask a question to get started

    Enter to send•Shift+Enter new line

    Menu

    OverviewGraphsFunctional APIPregelCheckpointingStorageCachingTypesRuntimeConfigErrorsConstantsChannelsAgents
    LangGraph Checkpoint
    LangGraph Store
    Checkpoint Postgres
    Store Postgres
    Checkpoint SQLite
    LangGraph Prebuilt
    LangGraph CLI
    LangGraph SDK
    LangGraph Supervisor
    LangGraph Swarm
    Language
    Theme
    PythonlanggraphtypesTracePolicy
    Classā—Since v1.2

    TracePolicy

    Copy
    TracePolicy(
      self,
      *,
      process_inputs: Callable[[Any], Any] | None = None,

    Constructors

    Attributes

    View source on GitHub
    process_outputs
    :
    Callable
    [
    [
    Any
    ]
    ,
    Any
    ]
    |
    None
    =
    None
    )
    constructor
    __init__
    NameType
    process_inputsCallable[[Any], Any] | None
    process_outputsCallable[[Any], Any] | None
    attribute
    process_inputs: Callable[[Any], Any] | None
    attribute
    process_outputs: Callable[[Any], Any] | None

    Configuration for how a node's run is traced.

    Scope: this only transforms what the node's own run records. Child runs created by a traced bound runnable and the root graph run are not affected. Plain function nodes are traced with trace=False, so they have no such child runs.

    Not intended to redact secrets. To redact inputs/outputs across all runs (children included), use the LangSmith client's hide_inputs/hide_outputs/anonymizer instead.

    Each processor receives the node's raw input/output value (not a normalized kwargs dict) and returns the value to record.

    Optional callable to transform the node's input before it is recorded on the node's trace run. Can be used to omit or summarize large payloads (e.g. message history). Not intended to affect the value passed to the node; avoid mutating arguments in place.

    Optional callable to transform the node's output before it is recorded on the node's trace run. Can be used to omit or summarize large payloads (e.g. message history). Not intended to affect the value returned by the node; avoid mutating arguments in place.