QOwnNotes/docs/scripting/examples/ai-autocompletion.qml
2024-05-17 19:37:29 +02:00

17 lines
471 B
QML

import QtQml 2.0
import QOwnNotesTypes 1.0
/**
* This script is an example for using the AI completer to complete the current
* line and adding text to the autocompletion list
*/
Script {
/**
* Hook to feed the autocompletion AI generated text
*/
function autocompletionHook() {
const text = script.noteTextEditCurrentBlock();
return script.aiComplete("Complete this sentence, don't add the text from the prompt: " + text);
}
}