LangChain Reference home pageLangChain ReferenceLangChain Reference
  • GitHub
  • Main Docs
Deep Agents
LangChain
LangGraph
Integrations
LangSmith
  • Overview
  • Client
  • AsyncClient
  • Run Helpers
  • Run Trees
  • Evaluation
  • Schemas
  • Utilities
  • Wrappers
  • Anonymizer
  • Testing
  • Expect API
  • Middleware
  • Pytest Plugin
  • Deployment SDK
  • RemoteGraph
⌘I

LangChain Assistant

Ask a question to get started

Enter to send•Shift+Enter new line

Menu

OverviewClientAsyncClientRun HelpersRun TreesEvaluationSchemasUtilitiesWrappersAnonymizerTestingExpect APIMiddlewarePytest PluginDeployment SDKRemoteGraph
Language
Theme
PythonlangsmithanonymizerRuleNodeProcessor
Class●Since v0.1

RuleNodeProcessor

String node processor that uses a list of rules to replace sensitive data.

Copy
RuleNodeProcessor(
    self,
    rules: list[StringNodeRule],
)

Bases

StringNodeProcessor

Constructors

constructor
__init__
NameType
ruleslist[StringNodeRule]

Attributes

attribute
rules: list[StringNodeRule]

List of rules to apply for replacing sensitive data.

Each rule is a StringNodeRule, which contains a regex pattern to match and an optional replacement string.

Methods

method
mask_nodes

Mask nodes using the rules.

View source on GitHub