Skip to content

armgit / TREK

Public Imported from GitHub
0

The most complete open-source travel planner: real-time collaboration, bookings, budgets, packing lists, journals, offline PWA, SSO and an AI-ready MCP server, with planet-wide place search and routing built in.

901 B
Raw Blame
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) };
  }
}