From ad9c9b27fc20467aa2c8d4fb41dab344188dd9ba Mon Sep 17 00:00:00 2001 From: gamgyul163 Date: Tue, 26 Nov 2024 20:19:15 +0900 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat:=20=EC=B1=84=ED=8C=85=20?= =?UTF-8?q?=ED=95=84=ED=84=B0=EB=A7=81=20api=20=EC=9A=94=EC=B2=AD=20postda?= =?UTF-8?q?ta=20=EC=88=98=EC=A0=95=20=EB=B0=8F=20=EB=9D=BD=ED=82=A4=20?= =?UTF-8?q?=EC=98=A4=EB=A5=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Backend/apps/api/src/chats/chats.service.ts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Backend/apps/api/src/chats/chats.service.ts b/Backend/apps/api/src/chats/chats.service.ts index 9b4c02af..20bf7f20 100644 --- a/Backend/apps/api/src/chats/chats.service.ts +++ b/Backend/apps/api/src/chats/chats.service.ts @@ -57,9 +57,16 @@ export class ChatsService { }, { role: 'user', - content: `채팅내용 : ${chat.content}`, + content: `채팅내용 : "${chat.content}"`, }, ], + maxTokens: this.configService.get('CLOVA_CHAT_FILTERING_MAX_TOKEN') || 10, + topP: 0.8, + topK: 1, + temperature: 0.1, + repeatPenalty: 1.0, + includeAiFilters: true, + seed: 0, }; const { data } = await firstValueFrom( this.httpService.post(this.configService.get('CLOVA_API_URL'), postData, { @@ -88,7 +95,7 @@ export class ChatsService { const lock = await this.redisClient.set(lockKey, 'lock', 'NX'); try { - if (lockKey) { + if (lock) { while (true) { const frontChatId = await this.redisClient.lindex('chatQueue', 0); const chatString = await this.redisClient.hget('chatCache', frontChatId);