From f34cb3368b317fb9f5efbe7209a4be0c25f5e765 Mon Sep 17 00:00:00 2001 From: Amruth-Vamshi Date: Tue, 27 Jun 2023 13:38:22 +0530 Subject: [PATCH 1/5] remove auth for bot request --- src/app.service.ts | 1 + src/socket/socket.gateway.ts | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app.service.ts b/src/app.service.ts index cd99d22..426bd35 100644 --- a/src/app.service.ts +++ b/src/app.service.ts @@ -38,6 +38,7 @@ export class AppService { messageId: this.randomId(), }; const params = JSON.stringify(reqst); + console.log('params',params) this.logger.log({ message: `Adapter Request => ${params}` }); this.httpService .post(`${adapterEndpoint}/prompt`, params, { diff --git a/src/socket/socket.gateway.ts b/src/socket/socket.gateway.ts index 1fcf6ae..e4f9017 100644 --- a/src/socket/socket.gateway.ts +++ b/src/socket/socket.gateway.ts @@ -62,7 +62,7 @@ export class SocketGateway await this.cacheManager.set(client['userID'], null, 86400 * 1000); } - @UseGuards(WsGuard) + // @UseGuards(WsGuard) @SubscribeMessage('botRequest') async handleMessage(client: Socket, { content, to, conversationId }: any) { this.logger.log( From f275852c144a8ebdc2148e37c8de3e24efc73ee9 Mon Sep 17 00:00:00 2001 From: Amruth-Vamshi Date: Tue, 27 Jun 2023 13:42:27 +0530 Subject: [PATCH 2/5] removed duplicate function --- src/app.controller.ts | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/src/app.controller.ts b/src/app.controller.ts index 556fcfc..d2f2cf3 100644 --- a/src/app.controller.ts +++ b/src/app.controller.ts @@ -38,16 +38,4 @@ export class AppController { this.logger.error('Error while emitting bot response', error); } } - - @Post('/getClientId') - async adapterOutbound(@Request() req) { - try { - const { userId } = req.body; - const clientId: string = await this.cacheManager.get(userId); - return { status: 'OK', clientId }; - } catch (error) { - this.logger.error('Could not get the clientId for this userId', error); - } - } - } From fe6bb2cfe1b2a535bbbb8196ab791449a72febf9 Mon Sep 17 00:00:00 2001 From: Amruth-Vamshi Date: Wed, 28 Jun 2023 17:19:39 +0530 Subject: [PATCH 3/5] added identifier to bot request --- src/app.service.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/app.service.ts b/src/app.service.ts index 426bd35..b3643de 100644 --- a/src/app.service.ts +++ b/src/app.service.ts @@ -36,6 +36,7 @@ export class AppService { context: req.content.context, to: req.to, messageId: this.randomId(), + identifier: req.content.identifier }; const params = JSON.stringify(reqst); console.log('params',params) From 4d8a8141c73dcf06f9295e2638f8be2e3dd41a2f Mon Sep 17 00:00:00 2001 From: Amruth-Vamshi Date: Thu, 24 Aug 2023 11:27:02 +0530 Subject: [PATCH 4/5] added asrId in prompt input --- src/app.service.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app.service.ts b/src/app.service.ts index b3643de..77fd4d8 100644 --- a/src/app.service.ts +++ b/src/app.service.ts @@ -36,7 +36,8 @@ export class AppService { context: req.content.context, to: req.to, messageId: this.randomId(), - identifier: req.content.identifier + identifier: req.content.identifier, + asrId: req.content.asrId }; const params = JSON.stringify(reqst); console.log('params',params) From 7d18baab23ab3d444f56e2636d453065d8795ed9 Mon Sep 17 00:00:00 2001 From: Amruth-Vamshi Date: Thu, 24 Aug 2023 11:41:57 +0530 Subject: [PATCH 5/5] added auth for botRequest API --- src/socket/socket.gateway.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/socket/socket.gateway.ts b/src/socket/socket.gateway.ts index e4f9017..1fcf6ae 100644 --- a/src/socket/socket.gateway.ts +++ b/src/socket/socket.gateway.ts @@ -62,7 +62,7 @@ export class SocketGateway await this.cacheManager.set(client['userID'], null, 86400 * 1000); } - // @UseGuards(WsGuard) + @UseGuards(WsGuard) @SubscribeMessage('botRequest') async handleMessage(client: Socket, { content, to, conversationId }: any) { this.logger.log(