Skip to content

Commit

Permalink
fix(#36): ai api 속성 값들, config 데이터로 분리
Browse files Browse the repository at this point in the history
  • Loading branch information
kimhji committed Feb 6, 2025
1 parent e3ad57d commit 1639981
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 7 deletions.
14 changes: 14 additions & 0 deletions server/src/ai/ai.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,13 @@ export interface AIConfig {
role: string;
content: string;
};
TOPP: number;
TOPK: number;
MAXTOKENS: number;
TEMPERATURE: number;
REPEATPENALTY: number;
STOPBEFORE: Array<String>;
INCLUDEAIFILTERS: true;
}

export const AISummaryConfig = (
Expand All @@ -28,4 +35,11 @@ export const AISummaryConfig = (
- 이 글에 대한 요약은 해당 글을 홍보하고자 하는 목적으로 사용되며, 내부 내용에 대한 상세 사항은 응답에 포함되면 안됩니다.
- 답변 형태 : ~~~한 주제에 대해 다루고 있는 포스트입니다.`,
},
TOPP: 0.6,
TOPK: 0,
MAXTOKENS: 35,
TEMPERATURE: 0.1,
REPEATPENALTY: 2.0,
STOPBEFORE: [],
INCLUDEAIFILTERS: true,
});
14 changes: 7 additions & 7 deletions server/src/ai/ai.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ export class AIService {
content: feedData,
},
],
topP: 0.6,
topK: 0,
maxTokens: 35,
temperature: 0.1,
repeatPenalty: 2.0,
stopBefore: [],
includeAiFilters: true,
topP: AIConfig.TOPP,
topK: AIConfig.TOPK,
maxTokens: AIConfig.MAXTOKENS,
temperature: AIConfig.TEMPERATURE,
repeatPenalty: AIConfig.REPEATPENALTY,
stopBefore: AIConfig.STOPBEFORE,
includeAiFilters: AIConfig.INCLUDEAIFILTERS,
};
}

Expand Down

0 comments on commit 1639981

Please sign in to comment.