Prompt Editor:
XAI_PromptEditor lets you write a prompt locally or use text supplied by another node while keeping both sources available in your workflow. You can switch between manual and connected text without disconnecting the text source. The node also supports stored history for reviewing earlier text; viewing or editing that history does not, by itself, change the active prompt. This makes it useful when you want to compare a prompt you wrote with one generated elsewhere and send the selected text onward.
Prompt Editor Input Parameters:
source_mode
Selects which text source is active. Set it to MANUAL to use the local prompt, or LLM to use the connected text when a value is available. The default is MANUAL. The mode check ignores surrounding spaces and letter case for LLM; any other value is treated as MANUAL. Minimum and maximum values do not apply to this text setting.
current_prompt
The local prompt text. It becomes the active prompt in MANUAL mode and also serves as the fallback in LLM mode when no connected text value is available. The default is an empty string. There is no minimum or maximum text length specified in the source.
last_manual_input
A stored manual-prompt history value. It is retained for the editor interface but is not read when the node chooses its output, so changing it alone will not change the active prompt. The default is an empty string. There is no minimum or maximum text length specified in the source.
last_llm_input
A stored connected-text history value. It is retained for the editor interface but is not used as a substitute for the current connected text during execution. Changing it alone will not change the active prompt. The default is an empty string. There is no minimum or maximum text length specified in the source.
has_last_manual
Indicates whether a manual history value has been stored, including a value that is empty. The default is false; the available values are true and false. This history flag does not determine the active output.
has_last_llm
Indicates whether a connected-text history value has been stored, including a value that is empty. The default is false; the available values are true and false. This history flag does not determine the active output.
text
An optional connection for an upstream STRING value, such as text from another text node or an LLM node. In LLM mode, an available value becomes the active prompt; in MANUAL mode, it does not affect the output. If no value is available in LLM mode, the node uses current_prompt instead. The default is no connected value, represented in the source as None. There is no minimum or maximum text length specified.
Prompt Editor Output Parameters:
prompt
The active STRING prompt to pass to the next node. In MANUAL mode, it contains current_prompt. In LLM mode, it contains text when that value is available; otherwise, it contains current_prompt. An empty connected string is still a value, so in LLM mode it produces an empty output rather than triggering the fallback. History values do not directly change this output.
Prompt Editor Usage Tips:
- Keep a useful prompt in
current_promptwhen working inLLMmode so the node has a fallback if connected text is unavailable. - Connect a text-producing node to
text, then switchsource_modebetweenMANUALandLLMto compare the local and connected prompts without changing the connection. - Use
MANUALmode when you want the result to depend on your local prompt rather than the connected text. The node requests its lazytextinput whenLLMmode needs that value. - If you are inspecting stored history, check the active mode and prompt separately.
last_manual_input,last_llm_input, and their flags do not select the output.
Prompt Editor Common Errors and Solutions:
No node-specific error message is defined in the provided source
- Explanation: The supplied implementation does not define a custom error message, so the entries below describe possible symptoms rather than quoting errors guaranteed to appear.
- Solution: If execution fails, read the message shown by the node supplying
textor by the workflow, and check that the connected source provides aSTRING.
The output shows my manual prompt instead of connected text
- Explanation:
MANUALmode always usescurrent_prompt.LLMmode also falls back tocurrent_promptif no connected text value is available. - Solution: Set
source_modetoLLMand check that the upstream node is connected totextand provides a value.
The output is empty in LLM mode
- Explanation: A connected empty string counts as an available value. The node outputs that empty string instead of falling back to
current_prompt. - Solution: Check the text produced upstream. To use your local prompt instead, switch to
MANUALmode or change the upstream value.
Changing a history value does not change the output
- Explanation: The history fields and flags are retained for the editor interface but are not used to select the active prompt during execution.
- Solution: Edit
current_promptfor manual text, or change the value connected totextfor connected text. Then select the correspondingsource_mode.
An unexpected source mode behaves like MANUAL
- Explanation: Only
LLM, ignoring letter case and surrounding spaces, selects connected-text mode. Every other mode value is treated asMANUAL. - Solution: Set
source_modetoLLMto select connected text, orMANUALto select the local prompt.
