Learn how to use the Replace Words in Prompt node to perform text substitutions in your prompts before they reach the LLM.
The Replace Words in Prompt node allows you to define multiple find-and-replace rules to modify your prompts. Each replacement can use either plain text or regex patterns, with support for case-sensitive matching.
Let’s say you want to expand industry-specific acronyms to make prompts more clear:
Add a Replace Words in Prompt node before your LLM node
Add multiple replacements:
Find: “ML”, Replace: “Machine Learning”
Find: “NLP”, Replace: “Natural Language Processing”
Find: “CV”, Replace: “Computer Vision”
Enable “Case sensitive” for each to avoid replacing lowercase instances
This will convert technical text like “ML and NLP techniques in CV” to “Machine Learning and Natural Language Processing techniques in Computer Vision”