var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
var __param = (this && this.__param) || function (paramIndex, decorator) {
    return function (target, key) { decorator(target, key, paramIndex); }
};
import { Resolver, Mutation, Query, Arg, Ctx, ObjectType, Field, Int } from 'type-graphql';
import { LogError, LogStatus } from '@memberjunction/core';
import { AIPromptRunner } from '@memberjunction/ai-prompts';
import { AIPromptParams } from '@memberjunction/ai-core-plus';
import { ResolverBase } from '../generic/ResolverBase.js';
import { RequireSystemUser } from '../directives/RequireSystemUser.js';
import { AIEngine } from '@memberjunction/aiengine';
import { ChatParams, ChatMessageRole, GetAIAPIKey, BaseLLM } from '@memberjunction/ai';
import { MJGlobal } from '@memberjunction/global';
import { GetReadWriteProvider } from '../util.js';
let AIPromptRunResult = class AIPromptRunResult {
    success;
    output;
    parsedResult;
    error;
    executionTimeMs;
    tokensUsed;
    promptRunId;
    rawResult;
    validationResult;
    chatResult;
};
__decorate([
    Field(),
    __metadata("design:type", Boolean)
], AIPromptRunResult.prototype, "success", void 0);
__decorate([
    Field({ nullable: true }),
    __metadata("design:type", String)
], AIPromptRunResult.prototype, "output", void 0);
__decorate([
    Field({ nullable: true }),
    __metadata("design:type", String)
], AIPromptRunResult.prototype, "parsedResult", void 0);
__decorate([
    Field({ nullable: true }),
    __metadata("design:type", String)
], AIPromptRunResult.prototype, "error", void 0);
__decorate([
    Field({ nullable: true }),
    __metadata("design:type", Number)
], AIPromptRunResult.prototype, "executionTimeMs", void 0);
__decorate([
    Field({ nullable: true }),
    __metadata("design:type", Number)
], AIPromptRunResult.prototype, "tokensUsed", void 0);
__decorate([
    Field({ nullable: true }),
    __metadata("design:type", String)
], AIPromptRunResult.prototype, "promptRunId", void 0);
__decorate([
    Field({ nullable: true }),
    __metadata("design:type", String)
], AIPromptRunResult.prototype, "rawResult", void 0);
__decorate([
    Field({ nullable: true }),
    __metadata("design:type", String)
], AIPromptRunResult.prototype, "validationResult", void 0);
__decorate([
    Field({ nullable: true }),
    __metadata("design:type", String)
], AIPromptRunResult.prototype, "chatResult", void 0);
AIPromptRunResult = __decorate([
    ObjectType()
], AIPromptRunResult);
export { AIPromptRunResult };
let SimplePromptResult = class SimplePromptResult {
    success;
    result;
    resultObject;
    modelName;
    error;
    executionTimeMs;
};
__decorate([
    Field(),
    __metadata("design:type", Boolean)
], SimplePromptResult.prototype, "success", void 0);
__decorate([
    Field({ nullable: true }),
    __metadata("design:type", String)
], SimplePromptResult.prototype, "result", void 0);
__decorate([
    Field({ nullable: true }),
    __metadata("design:type", String)
], SimplePromptResult.prototype, "resultObject", void 0);
__decorate([
    Field(),
    __metadata("design:type", String)
], SimplePromptResult.prototype, "modelName", void 0);
__decorate([
    Field({ nullable: true }),
    __metadata("design:type", String)
], SimplePromptResult.prototype, "error", void 0);
__decorate([
    Field({ nullable: true }),
    __metadata("design:type", Number)
], SimplePromptResult.prototype, "executionTimeMs", void 0);
SimplePromptResult = __decorate([
    ObjectType()
], SimplePromptResult);
export { SimplePromptResult };
let EmbedTextResult = class EmbedTextResult {
    embeddings;
    modelName;
    vectorDimensions;
    error;
};
__decorate([
    Field(() => [[Number]]),
    __metadata("design:type", Array)
], EmbedTextResult.prototype, "embeddings", void 0);
__decorate([
    Field(),
    __metadata("design:type", String)
], EmbedTextResult.prototype, "modelName", void 0);
__decorate([
    Field(() => Int),
    __metadata("design:type", Number)
], EmbedTextResult.prototype, "vectorDimensions", void 0);
__decorate([
    Field({ nullable: true }),
    __metadata("design:type", String)
], EmbedTextResult.prototype, "error", void 0);
EmbedTextResult = __decorate([
    ObjectType()
], EmbedTextResult);
export { EmbedTextResult };
let RunAIPromptResolver = class RunAIPromptResolver extends ResolverBase {
    async executeAIPrompt(p, promptId, userPayload, data, overrideModelId, overrideVendorId, configurationId, skipValidation, templateData, responseFormat, temperature, topP, topK, minP, frequencyPenalty, presencePenalty, seed, stopSequences, includeLogProbs, topLogProbs, messages, rerunFromPromptRunID, systemPromptOverride) {
        const startTime = Date.now();
        try {
            LogStatus(`=== RUNNING AI PROMPT FOR ID: ${promptId} ===`);
            let parsedData = {};
            let parsedTemplateData = {};
            if (data) {
                try {
                    parsedData = JSON.parse(data);
                }
                catch (parseError) {
                    return {
                        success: false,
                        error: `Invalid JSON in data: ${parseError.message}`,
                        executionTimeMs: Date.now() - startTime
                    };
                }
            }
            if (templateData) {
                try {
                    parsedTemplateData = JSON.parse(templateData);
                }
                catch (parseError) {
                    return {
                        success: false,
                        error: `Invalid JSON in template data: ${parseError.message}`,
                        executionTimeMs: Date.now() - startTime
                    };
                }
            }
            const currentUser = this.GetUserFromPayload(userPayload);
            if (!currentUser) {
                return {
                    success: false,
                    error: 'Unable to determine current user',
                    executionTimeMs: Date.now() - startTime
                };
            }
            const promptEntity = await p.GetEntityObject('AI Prompts', currentUser);
            await promptEntity.Load(promptId);
            if (!promptEntity.IsSaved) {
                return {
                    success: false,
                    error: `AI Prompt with ID ${promptId} not found`,
                    executionTimeMs: Date.now() - startTime
                };
            }
            if (promptEntity.Status !== 'Active') {
                return {
                    success: false,
                    error: `AI Prompt "${promptEntity.Name}" is not active (Status: ${promptEntity.Status})`,
                    executionTimeMs: Date.now() - startTime
                };
            }
            const promptRunner = new AIPromptRunner();
            const promptParams = new AIPromptParams();
            promptParams.prompt = promptEntity;
            promptParams.data = parsedData;
            promptParams.templateData = parsedTemplateData;
            promptParams.configurationId = configurationId;
            promptParams.contextUser = currentUser;
            promptParams.skipValidation = skipValidation || false;
            promptParams.rerunFromPromptRunID = rerunFromPromptRunID;
            promptParams.systemPromptOverride = systemPromptOverride;
            if (overrideModelId || overrideVendorId) {
                promptParams.override = {
                    modelId: overrideModelId,
                    vendorId: overrideVendorId
                };
            }
            if (messages) {
                try {
                    promptParams.conversationMessages = JSON.parse(messages);
                }
                catch (parseError) {
                    promptParams.conversationMessages = [{
                            role: 'user',
                            content: messages
                        }];
                }
            }
            if (responseFormat) {
                promptEntity.ResponseFormat = responseFormat;
            }
            const additionalParams = {};
            if (temperature != null)
                additionalParams.temperature = temperature;
            if (topP != null)
                additionalParams.topP = topP;
            if (topK != null)
                additionalParams.topK = topK;
            if (minP != null)
                additionalParams.minP = minP;
            if (frequencyPenalty != null)
                additionalParams.frequencyPenalty = frequencyPenalty;
            if (presencePenalty != null)
                additionalParams.presencePenalty = presencePenalty;
            if (seed != null)
                additionalParams.seed = seed;
            if (stopSequences != null)
                additionalParams.stopSequences = stopSequences;
            if (includeLogProbs != null)
                additionalParams.includeLogProbs = includeLogProbs;
            if (topLogProbs != null)
                additionalParams.topLogProbs = topLogProbs;
            if (Object.keys(additionalParams).length > 0) {
                promptParams.additionalParameters = additionalParams;
            }
            const result = await promptRunner.ExecutePrompt(promptParams);
            const executionTime = Date.now() - startTime;
            if (result.success) {
                LogStatus(`=== AI PROMPT RUN COMPLETED FOR: ${promptEntity.Name} (${executionTime}ms) ===`);
                return {
                    success: true,
                    output: result.rawResult,
                    parsedResult: typeof result.result === 'string' ? result.result : JSON.stringify(result.result),
                    rawResult: result.rawResult,
                    executionTimeMs: executionTime,
                    tokensUsed: result.tokensUsed,
                    promptRunId: result.promptRun?.ID,
                    validationResult: result.validationResult ? JSON.stringify(result.validationResult) : undefined,
                    chatResult: result.chatResult ? JSON.stringify(result.chatResult) : undefined
                };
            }
            else {
                LogError(`AI Prompt run failed for ${promptEntity.Name}: ${result.errorMessage}`);
                return {
                    success: false,
                    error: result.errorMessage,
                    executionTimeMs: executionTime,
                    promptRunId: result.promptRun?.ID,
                    chatResult: result.chatResult ? JSON.stringify(result.chatResult) : undefined
                };
            }
        }
        catch (error) {
            const executionTime = Date.now() - startTime;
            LogError(`AI Prompt run failed:`, undefined, error);
            return {
                success: false,
                error: error.message || 'Unknown error occurred',
                executionTimeMs: executionTime
            };
        }
    }
    async RunAIPrompt(promptId, { userPayload, providers }, data, overrideModelId, overrideVendorId, configurationId, skipValidation, templateData, responseFormat, temperature, topP, topK, minP, frequencyPenalty, presencePenalty, seed, stopSequences, includeLogProbs, topLogProbs, messages, rerunFromPromptRunID, systemPromptOverride) {
        const p = GetReadWriteProvider(providers);
        return this.executeAIPrompt(p, promptId, userPayload, data, overrideModelId, overrideVendorId, configurationId, skipValidation, templateData, responseFormat, temperature, topP, topK, minP, frequencyPenalty, presencePenalty, seed, stopSequences, includeLogProbs, topLogProbs, messages, rerunFromPromptRunID, systemPromptOverride);
    }
    async RunAIPromptSystemUser(promptId, { userPayload, providers }, data, overrideModelId, overrideVendorId, configurationId, skipValidation, templateData, responseFormat, temperature, topP, topK, minP, frequencyPenalty, presencePenalty, seed, stopSequences, includeLogProbs, topLogProbs, messages, rerunFromPromptRunID, systemPromptOverride) {
        const p = GetReadWriteProvider(providers);
        return this.executeAIPrompt(p, promptId, userPayload, data, overrideModelId, overrideVendorId, configurationId, skipValidation, templateData, responseFormat, temperature, topP, topK, minP, frequencyPenalty, presencePenalty, seed, stopSequences, includeLogProbs, topLogProbs, messages, rerunFromPromptRunID, systemPromptOverride);
    }
    async selectModelForSimplePrompt(preferredModels, modelPower, contextUser) {
        await AIEngine.Instance.Config(false, contextUser);
        const allModels = AIEngine.Instance.Models.filter(m => m.AIModelType?.trim().toLowerCase() === 'llm' &&
            m.IsActive === true);
        const modelsWithKeys = [];
        for (const model of allModels) {
            const apiKey = GetAIAPIKey(model.DriverClass);
            if (apiKey && apiKey.trim().length > 0) {
                modelsWithKeys.push(model);
            }
        }
        if (modelsWithKeys.length === 0) {
            throw new Error('No AI models with valid API keys found');
        }
        if (preferredModels && preferredModels.length > 0) {
            for (const preferred of preferredModels) {
                const model = modelsWithKeys.find(m => m.Name === preferred ||
                    m.APIName === preferred);
                if (model) {
                    LogStatus(`Selected preferred model: ${model.Name}`);
                    return model;
                }
            }
            LogStatus('No preferred models available, falling back to power selection');
        }
        modelsWithKeys.sort((a, b) => (b.PowerRank || 0) - (a.PowerRank || 0));
        let selectedModel;
        switch (modelPower) {
            case 'lowest':
                selectedModel = modelsWithKeys[modelsWithKeys.length - 1];
                break;
            case 'highest':
                selectedModel = modelsWithKeys[0];
                break;
            case 'medium':
            default:
                const midIndex = Math.floor(modelsWithKeys.length / 2);
                selectedModel = modelsWithKeys[midIndex];
                break;
        }
        LogStatus(`Selected model by power (${modelPower || 'medium'}): ${selectedModel.Name}`);
        return selectedModel;
    }
    selectEmbeddingModelBySize(modelSize) {
        const localModels = AIEngine.Instance.LocalEmbeddingModels;
        if (!localModels || localModels.length === 0) {
            throw new Error('No local embedding models available');
        }
        switch (modelSize) {
            case 'small':
                return localModels[localModels.length - 1];
            case 'medium':
            default:
                const midIndex = Math.floor(localModels.length / 2);
                return localModels[midIndex] || localModels[0];
        }
    }
    buildChatMessages(systemPrompt, messagesJson) {
        const messages = [];
        if (systemPrompt && systemPrompt.trim().length > 0) {
            messages.push({
                role: ChatMessageRole.system,
                content: systemPrompt
            });
        }
        if (messagesJson) {
            try {
                const parsedMessages = JSON.parse(messagesJson);
                if (Array.isArray(parsedMessages)) {
                    for (const msg of parsedMessages) {
                        if (msg.message && msg.role) {
                            messages.push({
                                role: msg.role === 'user' ? ChatMessageRole.user : ChatMessageRole.assistant,
                                content: msg.message
                            });
                        }
                    }
                }
                else if (messagesJson?.length > 0) {
                    messages.push({
                        role: ChatMessageRole.user,
                        content: messagesJson
                    });
                }
            }
            catch (e) {
                if (messagesJson?.length > 0) {
                    messages.push({
                        role: ChatMessageRole.user,
                        content: messagesJson
                    });
                }
                LogError('Failed to parse messages JSON', undefined, e);
            }
        }
        return messages;
    }
    formatSimpleResult(chatResult, model, executionTime) {
        if (!chatResult || !chatResult.success) {
            return {
                success: false,
                error: chatResult?.errorMessage || 'Unknown error occurred',
                modelName: model.Name,
                executionTimeMs: executionTime
            };
        }
        const resultContent = chatResult.data?.choices?.[0]?.message?.content || '';
        let resultObject = null;
        try {
            resultObject = JSON.parse(resultContent);
        }
        catch (e) {
            const jsonMatch = resultContent.match(/\{[\s\S]*\}|\[[\s\S]*\]/);
            if (jsonMatch) {
                try {
                    resultObject = JSON.parse(jsonMatch[0]);
                }
                catch (e2) {
                }
            }
        }
        return {
            success: true,
            result: resultContent,
            resultObject: resultObject ? JSON.stringify(resultObject) : undefined,
            modelName: model.Name,
            executionTimeMs: executionTime
        };
    }
    async ExecuteSimplePrompt(systemPrompt, { userPayload }, messages, preferredModels, modelPower, responseFormat) {
        const startTime = Date.now();
        try {
            LogStatus(`=== EXECUTING SIMPLE PROMPT ===`);
            const currentUser = this.GetUserFromPayload(userPayload);
            if (!currentUser) {
                return {
                    success: false,
                    error: 'Unable to determine current user',
                    modelName: 'Unknown',
                    executionTimeMs: Date.now() - startTime
                };
            }
            const model = await this.selectModelForSimplePrompt(preferredModels, modelPower || 'medium', currentUser);
            const chatMessages = this.buildChatMessages(systemPrompt, messages);
            if (chatMessages.length === 0) {
                return {
                    success: false,
                    error: 'No messages to send to model',
                    modelName: model.Name,
                    executionTimeMs: Date.now() - startTime
                };
            }
            const apiKey = GetAIAPIKey(model.DriverClass);
            const llm = MJGlobal.Instance.ClassFactory.CreateInstance(BaseLLM, model.DriverClass, apiKey);
            if (!llm) {
                return {
                    success: false,
                    error: `Failed to create LLM instance for model ${model.Name}`,
                    modelName: model.Name,
                    executionTimeMs: Date.now() - startTime
                };
            }
            const chatParams = new ChatParams();
            chatParams.messages = chatMessages;
            chatParams.model = model.APIName;
            if (responseFormat) {
                chatParams.responseFormat = responseFormat;
            }
            const result = await llm.ChatCompletion(chatParams);
            const executionTime = Date.now() - startTime;
            LogStatus(`=== SIMPLE PROMPT COMPLETED (${executionTime}ms) ===`);
            return this.formatSimpleResult(result, model, executionTime);
        }
        catch (error) {
            const executionTime = Date.now() - startTime;
            LogError('Simple prompt execution failed:', undefined, error);
            return {
                success: false,
                error: error.message || 'Unknown error occurred',
                modelName: 'Unknown',
                executionTimeMs: executionTime
            };
        }
    }
    async ExecuteSimplePromptSystemUser(systemPrompt, { userPayload }, messages, preferredModels, modelPower, responseFormat) {
        return this.ExecuteSimplePrompt(systemPrompt, { userPayload }, messages, preferredModels, modelPower, responseFormat);
    }
    async EmbedText(textToEmbed, modelSize, { userPayload }) {
        try {
            LogStatus(`=== GENERATING EMBEDDINGS for ${textToEmbed.length} text(s) ===`);
            const currentUser = this.GetUserFromPayload(userPayload);
            if (!currentUser) {
                return {
                    embeddings: [],
                    modelName: 'Unknown',
                    vectorDimensions: 0,
                    error: 'Unable to determine current user'
                };
            }
            await AIEngine.Instance.Config(false, currentUser);
            const model = this.selectEmbeddingModelBySize(modelSize);
            LogStatus(`Using embedding model: ${model.Name}`);
            const embeddings = [];
            for (const text of textToEmbed) {
                if (!text || text.trim().length === 0) {
                    embeddings.push([]);
                    continue;
                }
                const result = await AIEngine.Instance.EmbedText(model, text);
                if (result && result.vector && result.vector.length > 0) {
                    embeddings.push(result.vector);
                }
                else {
                    LogError(`Failed to generate embedding for text: ${text.substring(0, 50)}...`);
                    embeddings.push([]);
                }
            }
            const vectorDimensions = embeddings.find(e => e.length > 0)?.length || 0;
            LogStatus(`=== EMBEDDINGS GENERATED: ${embeddings.length} vectors of ${vectorDimensions} dimensions ===`);
            return {
                embeddings,
                modelName: model.Name,
                vectorDimensions,
                error: undefined
            };
        }
        catch (error) {
            LogError('Embedding generation failed:', undefined, error);
            return {
                embeddings: [],
                modelName: 'Unknown',
                vectorDimensions: 0,
                error: error.message || 'Unknown error occurred'
            };
        }
    }
    async EmbedTextSystemUser(textToEmbed, modelSize, { userPayload }) {
        return this.EmbedText(textToEmbed, modelSize, { userPayload });
    }
};
__decorate([
    Mutation(() => AIPromptRunResult),
    __param(0, Arg('promptId')),
    __param(1, Ctx()),
    __param(2, Arg('data', { nullable: true })),
    __param(3, Arg('overrideModelId', { nullable: true })),
    __param(4, Arg('overrideVendorId', { nullable: true })),
    __param(5, Arg('configurationId', { nullable: true })),
    __param(6, Arg('skipValidation', { nullable: true })),
    __param(7, Arg('templateData', { nullable: true })),
    __param(8, Arg('responseFormat', { nullable: true })),
    __param(9, Arg('temperature', { nullable: true })),
    __param(10, Arg('topP', { nullable: true })),
    __param(11, Arg('topK', () => Int, { nullable: true })),
    __param(12, Arg('minP', { nullable: true })),
    __param(13, Arg('frequencyPenalty', { nullable: true })),
    __param(14, Arg('presencePenalty', { nullable: true })),
    __param(15, Arg('seed', () => Int, { nullable: true })),
    __param(16, Arg('stopSequences', () => [String], { nullable: true })),
    __param(17, Arg('includeLogProbs', { nullable: true })),
    __param(18, Arg('topLogProbs', () => Int, { nullable: true })),
    __param(19, Arg('messages', { nullable: true })),
    __param(20, Arg('rerunFromPromptRunID', { nullable: true })),
    __param(21, Arg('systemPromptOverride', { nullable: true })),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [String, Object, String, String, String, String, Boolean, String, String, Number, Number, Number, Number, Number, Number, Number, Array, Boolean, Number, String, String, String]),
    __metadata("design:returntype", Promise)
], RunAIPromptResolver.prototype, "RunAIPrompt", null);
__decorate([
    RequireSystemUser(),
    Query(() => AIPromptRunResult),
    __param(0, Arg('promptId')),
    __param(1, Ctx()),
    __param(2, Arg('data', { nullable: true })),
    __param(3, Arg('overrideModelId', { nullable: true })),
    __param(4, Arg('overrideVendorId', { nullable: true })),
    __param(5, Arg('configurationId', { nullable: true })),
    __param(6, Arg('skipValidation', { nullable: true })),
    __param(7, Arg('templateData', { nullable: true })),
    __param(8, Arg('responseFormat', { nullable: true })),
    __param(9, Arg('temperature', { nullable: true })),
    __param(10, Arg('topP', { nullable: true })),
    __param(11, Arg('topK', () => Int, { nullable: true })),
    __param(12, Arg('minP', { nullable: true })),
    __param(13, Arg('frequencyPenalty', { nullable: true })),
    __param(14, Arg('presencePenalty', { nullable: true })),
    __param(15, Arg('seed', () => Int, { nullable: true })),
    __param(16, Arg('stopSequences', () => [String], { nullable: true })),
    __param(17, Arg('includeLogProbs', { nullable: true })),
    __param(18, Arg('topLogProbs', () => Int, { nullable: true })),
    __param(19, Arg('messages', { nullable: true })),
    __param(20, Arg('rerunFromPromptRunID', { nullable: true })),
    __param(21, Arg('systemPromptOverride', { nullable: true })),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [String, Object, String, String, String, String, Boolean, String, String, Number, Number, Number, Number, Number, Number, Number, Array, Boolean, Number, String, String, String]),
    __metadata("design:returntype", Promise)
], RunAIPromptResolver.prototype, "RunAIPromptSystemUser", null);
__decorate([
    Mutation(() => SimplePromptResult),
    __param(0, Arg('systemPrompt')),
    __param(1, Ctx()),
    __param(2, Arg('messages', { nullable: true })),
    __param(3, Arg('preferredModels', () => [String], { nullable: true })),
    __param(4, Arg('modelPower', { nullable: true })),
    __param(5, Arg('responseFormat', { nullable: true })),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [String, Object, String, Array, String, String]),
    __metadata("design:returntype", Promise)
], RunAIPromptResolver.prototype, "ExecuteSimplePrompt", null);
__decorate([
    RequireSystemUser(),
    Query(() => SimplePromptResult),
    __param(0, Arg('systemPrompt')),
    __param(1, Ctx()),
    __param(2, Arg('messages', { nullable: true })),
    __param(3, Arg('preferredModels', () => [String], { nullable: true })),
    __param(4, Arg('modelPower', { nullable: true })),
    __param(5, Arg('responseFormat', { nullable: true })),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [String, Object, String, Array, String, String]),
    __metadata("design:returntype", Promise)
], RunAIPromptResolver.prototype, "ExecuteSimplePromptSystemUser", null);
__decorate([
    Mutation(() => EmbedTextResult),
    __param(0, Arg('textToEmbed', () => [String])),
    __param(1, Arg('modelSize')),
    __param(2, Ctx()),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Array, String, Object]),
    __metadata("design:returntype", Promise)
], RunAIPromptResolver.prototype, "EmbedText", null);
__decorate([
    RequireSystemUser(),
    Query(() => EmbedTextResult),
    __param(0, Arg('textToEmbed', () => [String])),
    __param(1, Arg('modelSize')),
    __param(2, Ctx()),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Array, String, Object]),
    __metadata("design:returntype", Promise)
], RunAIPromptResolver.prototype, "EmbedTextSystemUser", null);
RunAIPromptResolver = __decorate([
    Resolver()
], RunAIPromptResolver);
export { RunAIPromptResolver };
//# sourceMappingURL=RunAIPromptResolver.js.map