// Build input prompt
initializeInputFile(buildAiQuery());
- // Prepare process builder
+ // Prepare a process builder
ProcessBuilder processBuilder = new ProcessBuilder();
processBuilder.command(getCliCommand().split("\\s+")); // Splitting the command string into tokens
// Handle process's error stream
handleErrorThread(process);
- // Handle process's output stream
+ // Handle the process's output stream
StringBuilder result = new StringBuilder();
Thread outputThread = handleResultThread(process, result);
* @return the cleaned AI response.
*/
private String cleanupAiResponse(String result) {
- // remove text before AI response marker
- int aIResponseIndex = result.lastIndexOf(AI_RESPONSE_MARKER);
- if (aIResponseIndex != -1) {
- result = result.substring(aIResponseIndex + AI_RESPONSE_MARKER.length());
- }
- // remove text after end of text marker, if it exists
+ // remove text after the end of text marker if it exists
if (mailQuery.model.endOfTextMarker != null) {
int endOfTextMarkerIndex = result.indexOf(mailQuery.model.endOfTextMarker);
if (endOfTextMarkerIndex != -1) {
"--flash-attn",
"--cache-type-k q8_0",
"--cache-type-v q8_0",
+ "--no-display-prompt",
"--no-warmup",
"--temp " + temperature,
"--ctx-size " + mailQuery.model.contextSizeTokens,