File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -5,8 +5,10 @@ import { ApiBody } from '@nestjs/swagger';
55import { Response } from 'express' ;
66
77import { AiService } from './ai.service' ;
8+ import { CreateHistoryDto } from './dto/create-history.dto' ;
89import { ImproveQuestionDto } from './dto/improve-question.dto' ;
910import { AiRequestValidationGuard } from './guards/restrict-request.guard' ;
11+ import { CreateHistorySwagger } from './swagger/create-history.swagger' ;
1012import { ImproveQuestionSwagger } from './swagger/improve-question.swagger' ;
1113import { ImproveReplySwagger } from './swagger/improve-reply.swagger' ;
1214import { RetryQuestionSwagger } from './swagger/retry-question.swagger' ;
@@ -27,7 +29,6 @@ export class AiController {
2729 res . setHeader ( 'Cache-Control' , 'no-cache' ) ;
2830 res . setHeader ( 'Connection' , 'keep-alive' ) ;
2931
30- let resultData = '' ;
3132 let chunkData = '' ;
3233 let buffer = '' ;
3334
@@ -110,4 +111,11 @@ export class AiController {
110111 const aiStream = await this . aiService . retryImproveReply ( retryImproveReplyDto ) ;
111112 this . handleStreamResponse ( aiStream , res ) ;
112113 }
114+
115+ @Post ( 'history' )
116+ @CreateHistorySwagger ( )
117+ @ApiBody ( { type : CreateHistoryDto } )
118+ public createHistory ( @Body ( ) createHistoryDto : CreateHistoryDto ) {
119+ this . aiService . createHistory ( createHistoryDto ) ;
120+ }
113121}
You can’t perform that action at this time.
0 commit comments