TextTools Plugin For Dify
Author: yizixuan
Version: 0.0.5
Type: tool
https://github.com/sqkkyzx/dify-plugin-text_tools
This plugin provides a series of tools for text processing, covering functions such as regular expression extraction, text replacement, hash calculation, encoding and decoding, as well as Deepseek thought chain cleaning, to meet different text processing needs.
Tool list
1. Regular expression extraction of text ()
- Function: Extract content from text using regular expressions, supporting the use of capture groups in the regular expression to extract results. only outputs the first matching result; outputs all matching results.
- Parameters:
- : Input text, required.
- : Regular expression, required.
- : Whether to ignore case, default .
- : Whether to make and take effect on each line, default .
- : Whether to make match all characters including line breaks, default .
- : Whether to make , , only match ASCII characters, default .
2. Text replacement ()
- Function: Replace all matching items in a string with the target string, supporting the use of regular expressions, and supporting the use of capture groups in the regular expression for searching and replacement.
- Parameters:
- : Input text, required.
- : Search content, required. If regular expression is enabled, this will be used as the regular expression for searching.
- : Replacement text, required.
- : Whether to use regular expression, default .
- : Whether to ignore case, default .
- : Whether to make and take effect on each line, default .
- : Whether to make match all characters including line breaks, default .
- : Whether to make , , only match ASCII characters, default .
3. Hash calculation ()
- Function: Calculate the hash value of the input text using MD5, SHA256, or SHA1 algorithm.
- Parameters:
- : Input text, required.
- : Hash algorithm, optional , , , required.
4. Encoding and decoding ()
- Function: Encode or decode text using URL, Base64, or Unicode.
- Parameters:
- : Input text, required.
- : Operation type, optional , , , , , , required.
5. Deepseek thought chain cleaning ()
- 「WARNING」Since the latest version of dify already has this function built-in, it will be removed from the plugin in future versions.
- Function: Clean up the thought chain content output by Deepseek, Volcengine v0.0.12 and XML TAG models to generate concise replies.
- Parameters:
- : Supports new options:
- (default)
- (火山方舟 v0.0.12)
- (通用XML标签提取)
6. Word Count ()
- Function: Count the number of lines, non-empty lines, characters, visible characters, Chinese characters, English words, English characters and characters excluding punctuation in the input text.
- Parameters:
- : The text to be counted, required.
Instructions for use
- Install the plugin: Add the plugin set to your development environment.
- Call the tool: Select the appropriate tool according to your needs and pass in the necessary parameters.
- Get the result: The tool will return the processed result, and you can perform further operations as needed.
If you have any questions or suggestions, please feel free to contact the developer.