aboutsummaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
authorgixita <kris.laermans@gmail.com>2024-02-08 17:12:12 +0100
committergixita <kris.laermans@gmail.com>2024-02-08 17:12:12 +0100
commitfc1d6985c9eb0c31b8ea05244e4a270d9ec8ffaa (patch)
treec3947541c4888bdd9c3c9bfa9efdbcdbb10370e0 /src/components
parent842fcd159675c4091952277526844b1eebf6df18 (diff)
downloadollama-logseq-fc1d6985c9eb0c31b8ea05244e4a270d9ec8ffaa.tar.xz
ollama-logseq-fc1d6985c9eb0c31b8ea05244e4a270d9ec8ffaa.zip
feat: Add custom prompt functionality to block
This commit introduces the capability for users to apply custom prompts defined in the configuration to a block. Key changes include: - A new configuration string to store the custom prompt. - A menu item 'Custom prompt on block'. - Implementation of a function to apply the custom prompt to a block, mirroring the existing 'summarize block' functionality.
Diffstat (limited to 'src/components')
-rw-r--r--src/components/OllamaCommandPallete.tsx6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/components/OllamaCommandPallete.tsx b/src/components/OllamaCommandPallete.tsx
index e8e9c42..d721892 100644
--- a/src/components/OllamaCommandPallete.tsx
+++ b/src/components/OllamaCommandPallete.tsx
@@ -6,7 +6,7 @@ import {
CommandItem,
CommandList,
} from "@/components/ui/command"
-import { convertToFlashCardCurrentBlock, DivideTaskIntoSubTasksCurrentBlock, summarize, summarizeBlock } from "@/ollama";
+import { convertToFlashCardCurrentBlock, DivideTaskIntoSubTasksCurrentBlock, summarize, summarizeBlock, customPromptBlock } from "@/ollama";
import { PromptAI } from "./PromptAI";
export function OllamaCommandPallete({ options, theme }: { options: string[], theme: string }) {
@@ -28,6 +28,10 @@ export function OllamaCommandPallete({ options, theme }: { options: string[], th
logseq.hideMainUI()
summarizeBlock()
break;
+ case "custom prompt on block":
+ logseq.hideMainUI()
+ customPromptBlock()
+ break;
case "convert to flash card":
logseq.hideMainUI()
convertToFlashCardCurrentBlock()