45 lines
No EOL
1.8 KiB
JavaScript
45 lines
No EOL
1.8 KiB
JavaScript
function _ts_decorate(decorators, target, key, desc) {
|
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
else for(var i = decorators.length - 1; i >= 0; i--)if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
}
|
|
function _ts_metadata(k, v) {
|
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
}
|
|
function _ts_param(paramIndex, decorator) {
|
|
return function(target, key) {
|
|
decorator(target, key, paramIndex);
|
|
};
|
|
}
|
|
import { Body, Controller, Post, Res } from '@nestjs/common';
|
|
import { ChatService } from './chat.service';
|
|
import { ChatRequestDto } from './dto/chat.dto';
|
|
export class ChatController {
|
|
constructor(chatService){
|
|
this.chatService = chatService;
|
|
}
|
|
async chat(dto, res) {
|
|
return this.chatService.streamChat(dto.session_id, dto.message, res);
|
|
}
|
|
}
|
|
_ts_decorate([
|
|
Post(),
|
|
_ts_param(0, Body()),
|
|
_ts_param(1, Res()),
|
|
_ts_metadata("design:type", Function),
|
|
_ts_metadata("design:paramtypes", [
|
|
typeof ChatRequestDto === "undefined" ? Object : ChatRequestDto,
|
|
typeof Response === "undefined" ? Object : Response
|
|
]),
|
|
_ts_metadata("design:returntype", Promise)
|
|
], ChatController.prototype, "chat", null);
|
|
ChatController = _ts_decorate([
|
|
Controller('chat'),
|
|
_ts_metadata("design:type", Function),
|
|
_ts_metadata("design:paramtypes", [
|
|
typeof ChatService === "undefined" ? Object : ChatService
|
|
])
|
|
], ChatController);
|
|
|
|
//# sourceMappingURL=chat.controller.js.map
|