Package org.machanism.machai.gw.reviewer
Class TextReviewer
java.lang.Object
org.machanism.machai.gw.reviewer.TextReviewer
- All Implemented Interfaces:
Reviewer
Reviewer implementation for generic guidance text files.
This reviewer only processes files named @guidance.txt. When such a
file is found, its full contents are returned formatted as a prompt fragment
with directory context for downstream processing.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionFormats the raw guidance content into a prompt fragment.String[]Returns the file extensions supported by this reviewer.Reads and formats the guidance file if the provided file is named@guidance.txt.
-
Constructor Details
-
TextReviewer
public TextReviewer()
-
-
Method Details
-
getSupportedFileExtensions
Returns the file extensions supported by this reviewer.- Specified by:
getSupportedFileExtensionsin interfaceReviewer- Returns:
- an array containing
"txt"
-
perform
Reads and formats the guidance file if the provided file is named@guidance.txt.- Specified by:
performin interfaceReviewer- Parameters:
projectDir- the project root directory used to compute related paths for contextguidancesFile- the file to analyze- Returns:
- the formatted guidance prompt, or
nullwhen the file is not a guidance file - Throws:
IOException- if an error occurs reading the file
-
getPrompt
Formats the raw guidance content into a prompt fragment.- Parameters:
projectDir- the project root directory used to compute related paths for contextguidancesFile- the guidance file (used to compute the parent directory context)guidance- the raw guidance content- Returns:
- the formatted prompt fragment, or the original guidance content if blank
-