diff --git a/src/main.tsx b/src/main.tsx index 4a0ee65..47a8c55 100644 --- a/src/main.tsx +++ b/src/main.tsx @@ -9,7 +9,8 @@ import settings, { import { getBlockContent } from './utils'; function main() { - const { apiKey, model, customPrompts } = logseq.settings as unknown as ISettings; + const { apiKey, model, customPrompts, tag } = + logseq.settings as unknown as ISettings; const prompts = [...Object.values(presetPrompts)]; if (customPrompts.enable) { @@ -55,14 +56,19 @@ function main() { case PromptOutputType.property: await logseq.Editor.updateBlock( uuid, - block?.content + `\n ${name.toLowerCase()}:: ${content}`, + block?.content + + ` #${tag}\n ${name.toLowerCase()}:: ${content}`, ); break; case PromptOutputType.insert: + await logseq.Editor.updateBlock( + uuid, + block?.content + ` #${tag}`, + ); await logseq.Editor.insertBlock(uuid, content); break; case PromptOutputType.replace: - await logseq.Editor.updateBlock(uuid, content); + await logseq.Editor.updateBlock(uuid, `${content} #${tag}`); break; } } diff --git a/src/settings.ts b/src/settings.ts index 87dbae1..8d53a6a 100644 --- a/src/settings.ts +++ b/src/settings.ts @@ -15,6 +15,7 @@ export interface IPromptOptions { export interface ISettings { apiKey: string; model: string; + tag: string; customPrompts: { enable: boolean; prompts: IPromptOptions[]; @@ -36,6 +37,13 @@ const settings: SettingSchemaDesc[] = [ description: 'Choose the OpenAI model (e.g., "gpt-3.5-turbo").', default: 'gpt-3.5-turbo', }, + { + key: 'tag', + type: 'string', + title: 'Tag', + description: 'Add specific tags to AI-generated content', + default: '[[🤖]]' + }, { key: 'customPrompts', type: 'object',