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';
5
5
import { Response } from 'express' ;
6
6
7
7
import { AiService } from './ai.service' ;
8
+ import { CreateHistoryDto } from './dto/create-history.dto' ;
8
9
import { ImproveQuestionDto } from './dto/improve-question.dto' ;
9
10
import { AiRequestValidationGuard } from './guards/restrict-request.guard' ;
11
+ import { CreateHistorySwagger } from './swagger/create-history.swagger' ;
10
12
import { ImproveQuestionSwagger } from './swagger/improve-question.swagger' ;
11
13
import { ImproveReplySwagger } from './swagger/improve-reply.swagger' ;
12
14
import { RetryQuestionSwagger } from './swagger/retry-question.swagger' ;
@@ -27,7 +29,6 @@ export class AiController {
27
29
res . setHeader ( 'Cache-Control' , 'no-cache' ) ;
28
30
res . setHeader ( 'Connection' , 'keep-alive' ) ;
29
31
30
- let resultData = '' ;
31
32
let chunkData = '' ;
32
33
let buffer = '' ;
33
34
@@ -110,4 +111,11 @@ export class AiController {
110
111
const aiStream = await this . aiService . retryImproveReply ( retryImproveReplyDto ) ;
111
112
this . handleStreamResponse ( aiStream , res ) ;
112
113
}
114
+
115
+ @Post ( 'history' )
116
+ @CreateHistorySwagger ( )
117
+ @ApiBody ( { type : CreateHistoryDto } )
118
+ public createHistory ( @Body ( ) createHistoryDto : CreateHistoryDto ) {
119
+ this . aiService . createHistory ( createHistoryDto ) ;
120
+ }
113
121
}
You can’t perform that action at this time.
0 commit comments