CognxSafeTrack
Claude Sonnet 4.6
refactor(debt): resolve all 10 technical debt items from audit
a966957 Download apps/api/src/services/ai/index.ts from safetrack/edtech: direct link, hf CLI and curl.
- Browser
- Download file 798 Bytes
-
https://huggingface.co/spaces/safetrack/edtech/resolve/main/apps/api/src/services/ai/index.ts
- Command line
-
hf download hf://spaces/safetrack/edtech/apps/api/src/services/ai/index.ts
-
curl -L -o index.ts https://huggingface.co/spaces/safetrack/edtech/resolve/main/apps/api/src/services/ai/index.ts
798 Bytes
| 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'; | |