From 20f49b09ad84fb8dc2b4f2283706fed7665b2028 Mon Sep 17 00:00:00 2001
From: Tom Spielvogel <35257265+IDLe-Engineering@users.noreply.github.com>
Date: Mon, 21 Oct 2024 10:50:58 +0200
Subject: [PATCH 1/3] Configuration Item for Initial LLM Instructions
---
extensions/void/src/sidebar/contextForConfig.tsx | 1 +
1 file changed, 1 insertion(+)
diff --git a/extensions/void/src/sidebar/contextForConfig.tsx b/extensions/void/src/sidebar/contextForConfig.tsx
index 0b0e569a..cce641e9 100644
--- a/extensions/void/src/sidebar/contextForConfig.tsx
+++ b/extensions/void/src/sidebar/contextForConfig.tsx
@@ -45,6 +45,7 @@ const voidConfigInfo: Record<
'anthropic',
configFields,
),
+ initialLLMInstuctions: configString('Your initial instructions for your LLM.', ''),
},
anthropic: {
apikey: configString('Anthropic API key.', ''),
From 06e759dcc6463121676266a2b5e25854a74140d7 Mon Sep 17 00:00:00 2001
From: Tom Spielvogel <35257265+IDLe-Engineering@users.noreply.github.com>
Date: Mon, 21 Oct 2024 10:54:33 +0200
Subject: [PATCH 2/3] Display initial LLM instruction field
---
extensions/void/src/sidebar/SidebarSettings.tsx | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/extensions/void/src/sidebar/SidebarSettings.tsx b/extensions/void/src/sidebar/SidebarSettings.tsx
index 27e2cdde..ba60cedd 100644
--- a/extensions/void/src/sidebar/SidebarSettings.tsx
+++ b/extensions/void/src/sidebar/SidebarSettings.tsx
@@ -89,6 +89,15 @@ export const SidebarSettings = () => {
})}
+
+
+
+
+
+
{/* Remove this after 10/21/24, this is just to give developers a heads up about the recent change */}
{`We recently updated Settings. To copy your old Void settings over, press Ctrl+Shift+P, `}
From 9a5f8e274147e7361dce20625eb3bd9589672287 Mon Sep 17 00:00:00 2001
From: Tom Spielvogel <35257265+IDLe-Engineering@users.noreply.github.com>
Date: Mon, 21 Oct 2024 10:56:46 +0200
Subject: [PATCH 3/3] Add initial LLM instructions to the prompt, if not
already sent
---
extensions/void/src/sidebar/SidebarChat.tsx | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/extensions/void/src/sidebar/SidebarChat.tsx b/extensions/void/src/sidebar/SidebarChat.tsx
index cdb8ae91..31e1dbc8 100644
--- a/extensions/void/src/sidebar/SidebarChat.tsx
+++ b/extensions/void/src/sidebar/SidebarChat.tsx
@@ -176,7 +176,13 @@ export const SidebarChat = () => {
const relevantFiles = await awaitVSCodeResponse('files')
// add message to chat history
- const userContent = userInstructionsStr(instructions, relevantFiles.files, selection)
+ let userContent = userInstructionsStr(instructions, relevantFiles.files, selection)
+
+ // check if the intial instructions have been send to the LLM
+ if (voidConfig.default.initialLLMInstuctions && !currentThread?.messages.some((message) => message.content.includes(voidConfig.default.initialLLMInstuctions))) {
+ userContent = voidConfig.default.initialLLMInstuctions + '\n\n' + userContent;
+ }
+
// console.log('prompt:\n', content)
const newHistoryElt: ChatMessage = { role: 'user', content: userContent, displayContent: instructions, selection, files }
addMessageToHistory(newHistoryElt)