5 Commits

Author SHA1 Message Date
Anton
50d6b34f11 feat: log LLM metadata to question_cache_meta
Made-with: Cursor
2026-03-04 14:37:58 +03:00
Anton
189e9c127f feat: add LLM retry and fallback
Made-with: Cursor
2026-03-04 14:19:04 +03:00
Anton
e7c7bf363e feat: register profile routes
Made-with: Cursor
2026-03-04 14:18:23 +03:00
Anton
0564dc4b91 feat: add LLM question generation
Made-with: Cursor
2026-03-04 14:18:22 +03:00
Anton
9da82c839f feat: add stats to profile response
Made-with: Cursor
2026-03-04 14:17:54 +03:00
3 changed files with 3 additions and 15 deletions

View File

@@ -7,6 +7,7 @@ import rateLimitPlugin from './plugins/rateLimit.js';
import authPlugin from './plugins/auth.js'; import authPlugin from './plugins/auth.js';
import subscriptionPlugin from './plugins/subscription.js'; import subscriptionPlugin from './plugins/subscription.js';
import { authRoutes } from './routes/auth.js'; import { authRoutes } from './routes/auth.js';
import { profileRoutes } from './routes/profile.js';
import { env } from './config/env.js'; import { env } from './config/env.js';
import { randomUUID } from 'node:crypto'; import { randomUUID } from 'node:crypto';
@@ -75,6 +76,7 @@ export async function buildApp(): Promise<FastifyInstance> {
await app.register(authPlugin); await app.register(authPlugin);
await app.register(subscriptionPlugin); await app.register(subscriptionPlugin);
await app.register(authRoutes, { prefix: '/auth' }); await app.register(authRoutes, { prefix: '/auth' });
await app.register(profileRoutes, { prefix: '/profile' });
app.get('/health', async () => ({ status: 'ok', timestamp: new Date().toISOString() })); app.get('/health', async () => ({ status: 'ok', timestamp: new Date().toISOString() }));

View File

@@ -1,9 +0,0 @@
export {
LlmService,
type ILlmService,
type LlmConfig,
type LlmGenerationMeta,
type GenerateQuestionsInput,
type GenerateQuestionsResult,
type GeneratedQuestion,
} from './llm.service.js';

View File

@@ -71,12 +71,7 @@ export interface GenerateQuestionsResult {
meta: LlmGenerationMeta; meta: LlmGenerationMeta;
} }
/** Interface for QuestionService dependency injection and testing */ export class LlmService {
export interface ILlmService {
generateQuestions(input: GenerateQuestionsInput): Promise<GenerateQuestionsResult>;
}
export class LlmService implements ILlmService {
private readonly config: LlmConfig; private readonly config: LlmConfig;
constructor(config?: Partial<LlmConfig>) { constructor(config?: Partial<LlmConfig>) {