Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | 6x 6x 6x 6x 6x 6x | import { Controller, Get, Inject } from '@nestjs/common';
import { ApiTags, ApiOperation, ApiResponse } from '@nestjs/swagger';
import { LLM_PROVIDER, LlmProvider, LlmModel } from './llm-provider.interface';
@ApiTags('llm-provider')
@Controller('llm-provider')
export class LlmProviderController {
constructor(
@Inject(LLM_PROVIDER)
private readonly llmProvider: LlmProvider,
) {}
@Get('models')
@ApiOperation({ summary: 'Get list of available LLM models from provider' })
@ApiResponse({
status: 200,
description: 'List of models',
schema: {
properties: {
models: {
type: 'array',
items: {
type: 'object',
properties: { id: { type: 'string' }, name: { type: 'string' } },
},
},
},
},
})
async getModels(): Promise<{ models: LlmModel[] }> {
const models = await this.llmProvider.getModels();
return { models };
}
}
|