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
PythonlangsmithanonymizerRuleNodeProcessorrules
Attribute●Since v0.1

rules

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.

Copy
rules: list[StringNodeRule] = [{'pattern': rule['pattern'] if isinstance(
  rule['pattern'],
  re.Pattern) else re.compile(rule['pattern']), 'replace': rule['replace'] if isinstance(rule.get('replace'),
  str
) else '[redacted]'} for rule in rules]
View source on GitHub