"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.summarizeTrackOutcomeWithLLM = void 0;
const prompt_1 = require("./prompt");
/**
 * Uses LLM to summarize track outcomes and decision paths.
 * The function follows these steps:
 * 1. Formats prompt with instructions
 * 2. Runs LLM to generate summary
 * 3. Returns formatted summary
 *
 * @example
 * const summary = await summarizeTrackOutcomeWithLLM({
 *   model,
 *   careFlowActivities: "...",
 *   instructions: "Focus on decision path",
 *   metadata: { ... }
 * })
 */
const summarizeTrackOutcomeWithLLM = async ({ model, trackActivities, instructions = '', metadata, callbacks, }) => {
    const messages = await prompt_1.systemPrompt.formatMessages({
        input: trackActivities,
        instructions,
    });
    const response = await model.invoke(messages, {
        callbacks,
        runName: 'ShellySummarizeTrackOutcome',
        metadata,
    });
    return typeof response.content === 'string'
        ? response.content
        : JSON.stringify(response.content);
};
exports.summarizeTrackOutcomeWithLLM = summarizeTrackOutcomeWithLLM;
//# sourceMappingURL=summarizeTrackOutcomeWithLLM.js.map