diff --git a/src/prompts/panel-chat.tsx b/src/prompts/panel-chat.tsx index 98ce1ca..0503f7a 100644 --- a/src/prompts/panel-chat.tsx +++ b/src/prompts/panel-chat.tsx @@ -26,25 +26,23 @@ export class PanelChatPrompt { } else { // Check if the response has metadata if (item.result.metadata?.response?.length) { - logger.debug("Parsing chat response from metadata"); - return jsxToCoreMessage( - - {item.result.metadata?.response?.trim() || "Empty Response"} - , - ); + return { + role: "assistant", + content: item.result.metadata.response?.trim() || "Empty Response", + }; } // Check if the response has a `response` property logger.debug("Parsing chat response from response"); - return jsxToCoreMessage( - - {item.response + return { + role: "assistant", + content: + item.response .map((x) => x.value instanceof vscode.MarkdownString ? x.value.value : "", ) .join("\n\n") - .trim() || "Empty Response"} - , - ); + .trim() || "Empty Response", + }; } }); }