Grammar and spelling AI rule not working

Good mroning! I created a rule in Devonthink to update the grammar and spelling in a Markdown doc, but it doesn’t seem to be working. I am running 4.0.2, using GPT4All and Llama 3 8b Instruct. Here is my rule:

And here is my prompt and command:

You are an integrated assistant of DEVONthink 4.0.2, a document & knowledge management solution for macOS. Your replies should be concise and accurate. Be polite and helpful. Ask if something is unclear. In addition, format your replies using Markdown.

Correct all grammar and spelling errors in this Markdown text, but preserve Markdown formatting

When I run the rule, it shows it running in the bottom left of the window, but nothing seems to happen (maybe I’m missing an instructuion?). If I try to run this from the AI Chat (so opening a chat, pasting in the prompt, pasting in the command, then the text) I get a bunch of gobbly gook.

I’m very new to this type of AI usage, so I’m probably doing something wrong. If anyone has any pointers I would really appreciate it.

There are DT preferences permitting AI software to modify documents. Did you turn them on?

The Chat - Query action returns a value that can be used via the Query Response placeholder but the action is not able on its own to modify contents or properties as this is the job of the rule’s actions. Therefore two additional actions are required:

And the script looks like this:

on scriptOutput(theRecord, theInput)
	tell application id "DNtp" to set plain text of theRecord to theInput
end scriptOutput
2 Likes

Okay it’s almost there! When I made the changes the “Query Response” showed up just as text, where yours is in a blue box. When I ran the rule on a test file, it changed the file to just the words “Query Response.” How do I get those words to appear as a blue box in the rule?

Yes I did see that and I did turn that on.

Placeholder in the documentation. Option or command click (don’t remember which one) in the text field and then select from the list.

See the Windows > Predicate Editor section of the built-in Help and manual.

Okay! I’m so close on this. I figured out the placeholder, and it does run the query. However, when I run the rule on the test doc, I get a slightly weird output:


The paragraphs are getting fixed, but it’s putting in the extra code text and not changing the typos in the markdown titles. If that’s the worst thing I could live with it and just edit that stuff out, but is there anyway to fix this? Thank you for all your help everyone I’m so horrible at coding I’ve been trying to look this up but a lot of it just sails over my head.

What does the rule look like now?

Which model/provider did you use? Looks like one that doesn’t support tool calls and therefore a more precise prompt might be required.