Browse Source

refac: prompt template behaviour

Timothy Jaeryang Baek 2 months ago
parent
commit
352ed67667
1 changed files with 6 additions and 1 deletions
  1. 6 1
      src/lib/components/chat/MessageInput/Commands/Prompts.svelte

+ 6 - 1
src/lib/components/chat/MessageInput/Commands/Prompts.svelte

@@ -120,7 +120,12 @@
 			text = text.replaceAll('{{CURRENT_WEEKDAY}}', weekday);
 		}
 
-		prompt = text;
+		const promptWords = prompt.split(' ');
+
+		promptWords.pop();
+		promptWords.push(`${text}`);
+
+		prompt = promptWords.join(' ');
 
 		const chatInputContainerElement = document.getElementById('chat-input-container');
 		const chatInputElement = document.getElementById('chat-input');