Преглед на файлове

refac: prompt template behaviour

Timothy Jaeryang Baek преди 2 месеца
родител
ревизия
352ed67667
променени са 1 файла, в които са добавени 6 реда и са изтрити 1 реда
  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');