mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-23 05:21:15 +00:00
724c88c201
A mechanical prettier --write over server/src, server/tests, server/scripts and shared/src with the workspaces' .prettierrc; nothing but layout and import order changes, and every file keeps the same set of imports. shared is formatted throughout and its format baseline is empty. The server baseline keeps the 35 files that Prettier would grow past their lint:size limit (they need a split first, which is not a formatting change), and the generated entity files stay as their generator writes them.
23 lines
901 B
TypeScript
23 lines
901 B
TypeScript
import type { User } from '../../types';
|
|
import { CurrentUser } from '../auth-core/current-user.decorator';
|
|
import { JwtAuthGuard } from '../auth-core/jwt-auth.guard';
|
|
import { LlmParseService } from './llm-parse.service';
|
|
import { Controller, Get, UseGuards } from '@nestjs/common';
|
|
import type { LlmCapabilitiesResponse } from '@trek/shared';
|
|
|
|
/**
|
|
* What the caller's AI model can be handed. Per user, unlike the public
|
|
* /api/health/features: whose model applies depends on who is asking. The
|
|
* photo pickers read it to decide whether a photo is offered at all.
|
|
*/
|
|
@Controller('api/llm')
|
|
@UseGuards(JwtAuthGuard)
|
|
export class LlmCapabilitiesController {
|
|
constructor(private readonly llmParse: LlmParseService) {}
|
|
|
|
@Get('capabilities')
|
|
async capabilities(@CurrentUser() user: User): Promise<LlmCapabilitiesResponse> {
|
|
return { images: await this.llmParse.readsImages(user.id) };
|
|
}
|
|
}
|