"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.parsePrompt = void 0;
function parsePrompt(prompt) {
    const promptObj = JSON.parse(prompt);
    let response = [];
    if (promptObj.kwargs.messages) {
        promptObj.kwargs.messages.forEach((message) => {
            let messageType = message.id.includes('SystemMessagePromptTemplate')
                ? 'systemMessagePrompt'
                : message.id.includes('HumanMessagePromptTemplate')
                    ? 'humanMessagePrompt'
                    : message.id.includes('AIMessagePromptTemplate')
                        ? 'aiMessagePrompt'
                        : 'template';
            let messageTypeDisplay = message.id.includes('SystemMessagePromptTemplate')
                ? 'System Message'
                : message.id.includes('HumanMessagePromptTemplate')
                    ? 'Human Message'
                    : message.id.includes('AIMessagePromptTemplate')
                        ? 'AI Message'
                        : 'Message';
            let template = message.kwargs.prompt.kwargs.template;
            response.push({
                type: messageType,
                typeDisplay: messageTypeDisplay,
                template: template
            });
        });
    }
    else if (promptObj.kwargs.template) {
        let template = promptObj.kwargs.template;
        response.push({
            type: 'template',
            typeDisplay: 'Prompt',
            template: template
        });
    }
    return response;
}
exports.parsePrompt = parsePrompt;
//# sourceMappingURL=hub.js.map