From cd736ec682761629fd61bb488f6685144d4f5c27 Mon Sep 17 00:00:00 2001 From: maver Date: Tue, 8 Aug 2023 20:06:53 +0200 Subject: [PATCH] Add message role to inspect --- public/scripts/PromptManager.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/public/scripts/PromptManager.js b/public/scripts/PromptManager.js index 581537a86..0a649cc49 100644 --- a/public/scripts/PromptManager.js +++ b/public/scripts/PromptManager.js @@ -983,12 +983,11 @@ PromptManagerModule.prototype.loadPromptIntoEditForm = function (prompt) { PromptManagerModule.prototype.loadMessagesIntoInspectForm = function (messages) { if (!messages) return; - const createInlineDrawer = (title, content) => { + const createInlineDrawer = (title, content, role) => { let drawerHTML = `
- ${title} - ${title} + ${title} by ${role}
@@ -1008,7 +1007,7 @@ PromptManagerModule.prototype.loadMessagesIntoInspectForm = function (messages) messages.getCollection().forEach(message => { const truncatedTitle = message.content.length > 32 ? message.content.slice(0, 32) + '...' : message.content; - messageList.append(createInlineDrawer(message.identifier || truncatedTitle, message.content || 'No Content')); + messageList.append(createInlineDrawer(message.identifier || truncatedTitle, message.content || 'No Content', message.role)); }); }