import { PaginationDTO } from '@hed-hog/api-pagination';
import { PrismaService } from '@hed-hog/api-prisma';
import { OnModuleInit } from '@nestjs/common';
import { DeleteDTO } from '../dto/delete.dto';
import { FileService } from '../file/file.service';
import { IntegrationDeveloperApiService } from '../integration/services/integration-developer-api.service';
import { SettingService } from '../setting/setting.service';
import { ChatAgentDTO } from './dto/chat-agent.dto';
import { ChatDTO } from './dto/chat.dto';
import { CreateAgentDTO } from './dto/create-agent.dto';
import { UpdateAgentDTO } from './dto/update-agent.dto';
type AiProvider = 'openai' | 'gemini';
type AiAgentRecord = {
    id: number;
    slug: string;
    provider: AiProvider;
    model: string | null;
    instructions: string | null;
    external_agent_id: string | null;
    created_at: Date;
    updated_at: Date;
};
export declare class AiService implements OnModuleInit {
    private readonly prismaService;
    private readonly settingService;
    private readonly fileService;
    private readonly integrationApi;
    private readonly logger;
    constructor(prismaService: PrismaService, settingService: SettingService, fileService: FileService, integrationApi: IntegrationDeveloperApiService);
    onModuleInit(): void;
    chat(data: ChatDTO, file?: MulterFile): Promise<{
        provider: "openai";
        model: string;
        content: any;
    } | {
        provider: "gemini";
        model: string;
        content: any;
    }>;
    createAgent(data: CreateAgentDTO): Promise<AiAgentRecord>;
    listAgents(paginationParams: PaginationDTO): Promise<{
        data: AiAgentRecord[];
        total: number;
        page: number;
        pageSize: number;
        totalPages: number;
    }>;
    getAgentById(agentId: number): Promise<AiAgentRecord>;
    updateAgent(agentId: number, data: UpdateAgentDTO): Promise<AiAgentRecord>;
    deleteAgents({ ids }: DeleteDTO): Promise<{
        count: number;
    }>;
    chatWithAgent(slug: string, data: ChatAgentDTO, file?: MulterFile): Promise<{
        slug: string;
        provider: "openai";
        model: string;
        content: any;
    } | {
        slug: string;
        provider: "gemini";
        model: string;
        content: any;
    }>;
    getAgentBySlug(slug: string): Promise<AiAgentRecord>;
    extractAttachmentText(file?: MulterFile, fileId?: number): Promise<string>;
    debugAttachmentForLlm(file?: MulterFile, fileId?: number): Promise<{
        hasAttachment: boolean;
        filename: string;
        mimeType: string;
        bytes: number;
        mode: "image" | "text" | "binary" | "pdf-text";
        textLength: number;
        textSample: string;
        sha256: string;
    }>;
    private findAgentBySlug;
    private findAgentById;
    private getDefaultModel;
    private isAiProviderKeySlug;
    private getEnabledSlugFromProviderKey;
    private syncAllProviderEnabledFlags;
    private syncProviderEnabledFlag;
    private getValidationErrorMessage;
    private validateOpenAiKey;
    private validateGeminiKey;
    private getApiKeys;
    private chatWithOpenAi;
    private createOpenAiAssistant;
    private chatWithOpenAiAssistant;
    private chatWithGemini;
    private sleep;
    private resolveAttachment;
    private buildOpenAiUserContent;
    private isImageMime;
    private isTextMime;
    private isPdfMime;
    private normalizeAttachmentMimeType;
    private extractPdfText;
    private toUtf8Text;
}
export {};
//# sourceMappingURL=ai.service.d.ts.map