Skip to content

Commit

Permalink
✨ feat: 채팅 필터링 api 요청 postdata 수정 및 락키 오류 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
gamgyul163 committed Nov 26, 2024
1 parent a0d4818 commit ad9c9b2
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions Backend/apps/api/src/chats/chats.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,16 @@ export class ChatsService {
},
{
role: 'user',
content: `채팅내용 : ${chat.content}`,
content: `채팅내용 : "${chat.content}"`,
},
],
maxTokens: this.configService.get<number>('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<string>('CLOVA_API_URL'), postData, {
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit ad9c9b2

Please sign in to comment.