"use strict";
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); }
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.AiController = void 0;
const api_1 = require("@hed-hog/api");
const api_pagination_1 = require("@hed-hog/api-pagination");
const common_1 = require("@nestjs/common");
const platform_express_1 = require("@nestjs/platform-express");
const delete_dto_1 = require("../dto/delete.dto");
const ai_service_1 = require("./ai.service");
const chat_agent_dto_1 = require("./dto/chat-agent.dto");
const chat_dto_1 = require("./dto/chat.dto");
const create_agent_dto_1 = require("./dto/create-agent.dto");
const update_agent_dto_1 = require("./dto/update-agent.dto");
let AiController = class AiController {
    constructor(aiService) {
        this.aiService = aiService;
    }
    async chat(data, file) {
        return this.aiService.chat(data, file);
    }
    async createAgent(data) {
        return this.aiService.createAgent(data);
    }
    async listAgents(paginationParams) {
        return this.aiService.listAgents(paginationParams);
    }
    async getAgentById(agentId) {
        return this.aiService.getAgentById(agentId);
    }
    async getAgent(slug) {
        return this.aiService.getAgentBySlug(slug);
    }
    async updateAgent(agentId, data) {
        return this.aiService.updateAgent(agentId, data);
    }
    async deleteAgents(data) {
        return this.aiService.deleteAgents(data);
    }
    async chatWithAgent(slug, data, file) {
        return this.aiService.chatWithAgent(slug, data, file);
    }
};
exports.AiController = AiController;
__decorate([
    (0, common_1.Post)('chat'),
    (0, common_1.UseInterceptors)((0, platform_express_1.FileInterceptor)('file')),
    __param(0, (0, common_1.Body)()),
    __param(1, (0, common_1.UploadedFile)()),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [chat_dto_1.ChatDTO, Object]),
    __metadata("design:returntype", Promise)
], AiController.prototype, "chat", null);
__decorate([
    (0, common_1.Post)('agent'),
    __param(0, (0, common_1.Body)()),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [create_agent_dto_1.CreateAgentDTO]),
    __metadata("design:returntype", Promise)
], AiController.prototype, "createAgent", null);
__decorate([
    (0, common_1.Get)('agent'),
    __param(0, (0, api_pagination_1.Pagination)()),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object]),
    __metadata("design:returntype", Promise)
], AiController.prototype, "listAgents", null);
__decorate([
    (0, common_1.Get)('agent/id/:agentId'),
    __param(0, (0, common_1.Param)('agentId', common_1.ParseIntPipe)),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Number]),
    __metadata("design:returntype", Promise)
], AiController.prototype, "getAgentById", null);
__decorate([
    (0, common_1.Get)('agent/:slug'),
    __param(0, (0, common_1.Param)('slug')),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [String]),
    __metadata("design:returntype", Promise)
], AiController.prototype, "getAgent", null);
__decorate([
    (0, common_1.Patch)('agent/:agentId'),
    __param(0, (0, common_1.Param)('agentId', common_1.ParseIntPipe)),
    __param(1, (0, common_1.Body)()),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Number, update_agent_dto_1.UpdateAgentDTO]),
    __metadata("design:returntype", Promise)
], AiController.prototype, "updateAgent", null);
__decorate([
    (0, common_1.Delete)('agent'),
    __param(0, (0, common_1.Body)()),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [delete_dto_1.DeleteDTO]),
    __metadata("design:returntype", Promise)
], AiController.prototype, "deleteAgents", null);
__decorate([
    (0, common_1.Post)('agent/:slug/chat'),
    (0, common_1.UseInterceptors)((0, platform_express_1.FileInterceptor)('file')),
    __param(0, (0, common_1.Param)('slug')),
    __param(1, (0, common_1.Body)()),
    __param(2, (0, common_1.UploadedFile)()),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [String, chat_agent_dto_1.ChatAgentDTO, Object]),
    __metadata("design:returntype", Promise)
], AiController.prototype, "chatWithAgent", null);
exports.AiController = AiController = __decorate([
    (0, api_1.Role)(),
    (0, common_1.Controller)('ai'),
    __param(0, (0, common_1.Inject)((0, common_1.forwardRef)(() => ai_service_1.AiService))),
    __metadata("design:paramtypes", [ai_service_1.AiService])
], AiController);
//# sourceMappingURL=ai.controller.js.map