import { AIService as BaseAIService } from '@repo/ai-sdk'; import { prisma } from '../prisma'; import { redis } from '../../lib/redis'; import { getTenantSecrets } from '../organization'; import { getOrganizationId } from '@repo/database'; /** * API-specific instantiation of the AI Service. * Binds the core AI logic to the API's database, cache, and organization context. */ export const aiService = new BaseAIService({ prisma, redis: { get: (key: string) => redis.get(key), set: (key: string, value: string, _mode?: string, duration?: number) => duration ? redis.set(key, value, 'EX', duration) : redis.set(key, value) }, getTenantSecrets, getOrganizationId }); // Re-export types and other components if needed export * from '@repo/ai-sdk';