feat(小宝预警): 增加 AI 风险解读接口

This commit is contained in:
Script Generator
2026-06-29 18:59:11 +08:00
parent 7b1a48f1f7
commit 064617aba6
6 changed files with 596 additions and 1 deletions

View File

@@ -1,7 +1,13 @@
import { Body, Controller, Post } from '@nestjs/common';
import { AiService } from './ai.service';
import { DecomposeDto } from './dto/decompose.dto';
import type { AgentDecomposeResponse, AgentDecomposeError } from '@ftb/shared';
import { RiskInterpretDto } from './dto/risk-interpret.dto';
import type {
AgentDecomposeResponse,
AgentDecomposeError,
AgentRiskInterpretResponse,
AgentRiskInterpretError,
} from '@ftb/shared';
@Controller('ai')
export class AiController {
@@ -11,4 +17,9 @@ export class AiController {
async decompose(@Body() dto: DecomposeDto): Promise<AgentDecomposeResponse | AgentDecomposeError> {
return this.aiService.decompose(dto);
}
@Post('risk-interpret')
async interpretRisk(@Body() dto: RiskInterpretDto): Promise<AgentRiskInterpretResponse | AgentRiskInterpretError> {
return this.aiService.interpretRisk(dto);
}
}