Set Text:
The Sage_SetText node is designed to facilitate the creation and manipulation of text by allowing you to set a base string and optionally append a prefix and/or suffix to it. This node is particularly useful when you need to construct text dynamically, such as generating prompts or assembling messages with specific formatting. By providing a straightforward method to concatenate strings, it enhances your ability to customize text outputs efficiently. The node's primary function is to take an input string and seamlessly integrate additional text elements, ensuring that your final output is both coherent and tailored to your specific needs.
Set Text Input Parameters:
str
This parameter represents the main body of text that you wish to manipulate. It serves as the core content to which you can add additional text elements. The str parameter is flexible, allowing for multiline input, which means you can input paragraphs or longer text blocks. There are no strict minimum or maximum values for this parameter, but it is essential to ensure that the text is meaningful and relevant to your intended output.
prefix
The prefix parameter allows you to prepend text to the main string. This can be particularly useful for adding introductory phrases or context to your text. While this parameter is optional, providing a prefix can significantly alter the tone or meaning of the final output. The prefix is also multiline, giving you the flexibility to add complex or lengthy introductory text if needed.
suffix
Similar to the prefix, the suffix parameter lets you append text to the end of the main string. This is useful for adding concluding remarks or additional information that complements the main content. Like the prefix, the suffix is optional and supports multiline input, allowing for comprehensive and detailed additions to your text.
Set Text Output Parameters:
str_out
The str_out parameter is the final output of the node, representing the fully constructed text after the optional prefix and suffix have been added to the main string. This output is crucial as it provides the complete text that you can use for further processing or display. The str_out ensures that all input elements are seamlessly integrated, resulting in a coherent and polished text output.
Set Text Usage Tips:
- To create dynamic prompts or messages, consider using variables or placeholders within the
strparameter that can be replaced or filled in later. - Use the
prefixandsuffixparameters to add context or additional information to your text, enhancing its clarity and impact.
Set Text Common Errors and Solutions:
Missing required input: str
- Explanation: This error occurs when the main text input is not provided, which is necessary for the node to function.
- Solution: Ensure that you provide a valid string in the
strparameter to avoid this error.
Invalid type for prefix or suffix
- Explanation: This error happens when the input for
prefixorsuffixis not a string, which is required for text concatenation. - Solution: Check that the inputs for
prefixandsuffixare strings and adjust them if necessary.
