Replies: 4 comments 1 reply
|
You can already run local models😁 |
Thank you, I understand how to use Ollama. However, there is a small issue: please tell me how to use "clipboard" this variable?When using this parameter with '<% tp.system.clipboard() %>', it will produce an error. |
|
😅I assumed that your plugin is compatible with the parameters of "Template". In summary, my requirement is to have AI read content from the clipboard and respond accordingly. Based on your usage guide, I've arranged a Clipboard2AI.js script as follows: Unfortunately, it doesn't take effect (no reaction at all) when inserted as a macro in quickadd. Could you please provide further guidance? |
|
Coming back to this late to close the loop on your script - sorry about that. It does nothing because it isn't a valid QuickAdd user script yet. A user script must export a function - top-level statements are never executed, so QuickAdd finds no entry point and silently skips the file. Also, Corrected version: const model = "wangshenzhi/llama3-8b-chinese-chat-ollama-q8";
module.exports = async ({ quickAddApi }) => {
const clip = await quickAddApi.utility.getClipboard();
await quickAddApi.ai.prompt(clip, model, {
variableName: "AnswerOfAI",
shouldAssignVariables: true,
modelOptions: {
temperature: 1,
max_tokens: 10000,
frequency_penalty: 0.1,
presence_penalty: 0.1,
},
showAssistantMessages: true,
systemPrompt: "请回答问题。",
});
};Two changes beyond the User script structure is covered here: https://quickadd.obsidian.guide/docs/UserScripts |

Uh oh!
There was an error while loading. Please reload this page.
Will Al Assistant consider supporting Ollama or similar local storage options in the future?
Best regards.
All reactions