Action
Basic Prompt
Posted by agiletortoise,
Last update
1 day ago
Submit the content of the current draft to the local, on-device model as a prompt and get a text response.
The draft will be updated to include the response.
This action is meant as an example action to demonstrate the use of SystemLanguageModel
scripting. (docs)
(requires iOS/macOS 26 + Apple Intelligence)
Steps
-
script
let prompt = draft.processTemplate("[[draft]]") let lm = new SystemLanguageModel() let response = lm.respond(prompt) if (!response) { alert(lm.lastError) context.fail() } else { editor.setText(`${prompt} === ${response}`) }
Options
-
After Success Default Notification Info Log Level Info
Items available in the Drafts Directory are uploaded by community members. Use appropriate caution reviewing downloaded items before use.