Skip to content

Commit

Permalink
♻️ refactor: 태그 목록 리스트로 관리하도록 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
Jo-Minseok committed Feb 12, 2025
1 parent 5be66c4 commit 752194b
Showing 1 changed file with 28 additions and 23 deletions.
51 changes: 28 additions & 23 deletions server/src/rss/service/ai-tag-summary.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,32 @@ import { Injectable } from '@nestjs/common';
import { Anthropic } from '@anthropic-ai/sdk';
import { WinstonLoggerService } from '../../common/logger/logger.service';

const ALLOWED_TAGS = [
'회고',
'Frontend',
'Backend',
'DB',
'Network',
'OS',
'Algorithm',
'Infra',
'Engineering',
'TypeScript',
'JavaScript',
'Java',
'React',
'Vue.JS',
'Nest.JS',
'Express.JS',
'Spring',
'MySQL',
'SQLite',
'PostgreSQL',
'MongoDB',
'Redis',
'Docker',
];

const PROMPT_CONTENT = `[System]
You need to assign tags and provide a summary of the content.
The input format is XML.
Expand Down Expand Up @@ -41,29 +67,8 @@ The response should look exactly like this, without any surrounding characters:
Strictly follow this rule.
Tag List:
- 회고
- Frontend
- Backend
- DB
- Network
- OS
- Algorithm
- Infra
- Engineering
- TypeScript
- JavaScript
- Java
- React
- Vue.JS
- Nest.JS
- Express.JS
- Spring
- MySQL
- SQLite
- PostgreSQL
- MongoDB
- Redis
- Docker`;
${ALLOWED_TAGS.map((tag) => `- ${tag}`).join('\n')}
`;

type AIResult = {
tags: Record<string, number>;
Expand Down

0 comments on commit 752194b

Please sign in to comment.