fix(rag): max_tokens 4096 확장 및 Thinking 모델 자연 추론을 위한 직관적 한국어 전문가 프롬프트 개편
This commit is contained in:
@@ -731,11 +731,11 @@ object RagService {
|
|||||||
put("temperature", 0.1)
|
put("temperature", 0.1)
|
||||||
put("top_p", 0.85)
|
put("top_p", 0.85)
|
||||||
put("top_k", 40)
|
put("top_k", 40)
|
||||||
put("max_tokens", 2000)
|
put("max_tokens", 4096)
|
||||||
putJsonArray("messages") {
|
putJsonArray("messages") {
|
||||||
addJsonObject {
|
addJsonObject {
|
||||||
put("role", "system")
|
put("role", "system")
|
||||||
put("content", "You are a helpful AI financial analyst. Keep your internal thinking very brief (under 50 words). If the news is unrelated or general market news, immediately output score 50.0. Output strictly in valid JSON format.")
|
put("content", "You are an expert AI financial analyst. Analyze the stock context and news thoroughly, then output strictly in valid JSON format.")
|
||||||
}
|
}
|
||||||
addJsonObject {
|
addJsonObject {
|
||||||
put("role", "user")
|
put("role", "user")
|
||||||
@@ -1002,41 +1002,29 @@ object RagService {
|
|||||||
|
|
||||||
private suspend fun getAiNewsScore(stockName: String, news: String, techSummary: String): Pair<Double, String> {
|
private suspend fun getAiNewsScore(stockName: String, news: String, techSummary: String): Pair<Double, String> {
|
||||||
val prompt = """
|
val prompt = """
|
||||||
# Role: Expert Quantitative & Sentiment Analyst
|
# Role: 전문 퀀트 및 금융 센티멘트 애널리스트
|
||||||
# Target Stock: [$stockName]
|
# 대상 종목: [$stockName]
|
||||||
|
|
||||||
# Task: Evaluate [News Text] by correlating it with [Market Context].
|
# 1. 기술적/재무적 마켓 컨텍스트:
|
||||||
|
|
||||||
# Input 1: [Market Context] (Standardized Scores & Price History)
|
|
||||||
$techSummary
|
$techSummary
|
||||||
|
|
||||||
# Input 2: [News Text] (Refined Facts & Headlines for $stockName)
|
# 2. 최근 정제된 뉴스 및 공시 내용:
|
||||||
$news
|
$news
|
||||||
|
|
||||||
# Evaluation Logic (Internal Reasoning):
|
# 분석 과업 (Task):
|
||||||
1. Value Gap: Compare 'Financial Score' with 'Base Position'. (e.g., High Score + Low Position = Strong Buy)
|
- 위 마켓 컨텍스트(기술/재무 지표, 장단기 추세, 거래량 에너지)와 최근 정제된 뉴스 내용을 종합 검토하여 [$stockName]의 투자 가치(모멘텀 및 센티멘트 점수)를 100점 만점으로 환산하고 그 핵심 이유를 한국어로 제시하세요.
|
||||||
2. Momentum Catalyst: Check if News justifies the 'Volume Intensity' and 'Weekly Breakout'.
|
- 실적 개선 기대, 사업 포트폴리오 강화, 주가 상승 모멘텀, 계약/수주 등의 호재가 있으면 60~90점대로 적극 평가하세요.
|
||||||
3. Sentiment Weight:
|
- 뚜렷한 악재(적자 지속, 횡령/배임, 희석 유상증자 등)가 있으면 10~40점대로 감점하세요.
|
||||||
- Positive: Earnings surprise, Contract win, Turnaround, Buyback. (+10~30)
|
- 뉴스가 없거나 중립적이면 50점 내외를 부여하세요.
|
||||||
- Negative: Deficit, Lawsuit, Capital increase (Dilution). (-20~40)
|
|
||||||
|
|
||||||
# Operational Instructions:
|
# 출력 규칙:
|
||||||
- If the news mentions specific profit figures (e.g., "72B KRW"), award a "Profit Bonus" even without YoY comparison.
|
- 반드시 유효한 JSON 형식으로만 출력하세요.
|
||||||
- If 'Base Position' is near 100% (at 120MA), consider it a 'Safe Entry' for long-term holding.
|
- reason은 한국어 50자 이내로 핵심 요점만 명확하게 작성하세요.
|
||||||
|
|
||||||
# Critical Rules (Short-Circuit & Constraints):
|
# JSON 출력 형식:
|
||||||
1. Short-Circuit: If [News Text] does NOT specifically mention [$stockName] or is general market/unrelated company news, DO NOT overthink. Immediately output:
|
|
||||||
{"score": 50.0, "reason": "관련 뉴스 없음 (중립)"}
|
|
||||||
2. Thinking Budget: Keep your internal thinking concise (under 50 words). Finish thinking quickly and output strictly valid JSON.
|
|
||||||
3. Target Isolation: You MUST ONLY extract facts related EXACTLY to [$stockName]. Do NOT attribute actions of other companies (e.g., unrelated capital increases or earnings of competitors) to [$stockName].
|
|
||||||
4. Verify Numbers: Check if [$stockName]'s YoY profit is Positive (+) or Negative (-). If Negative, reflect it as a penalty in the score.
|
|
||||||
5. Reason: KOREAN only, max 50 chars. Explain the "Synergy" between scores and news.
|
|
||||||
6. Output: Strictly JSON format.
|
|
||||||
|
|
||||||
# JSON Output:
|
|
||||||
{
|
{
|
||||||
"score": [0.0-100.0],
|
"score": [0.0-100.0],
|
||||||
"reason": "[KOREAN_REASON]"
|
"reason": "[한국어 분석 요약 (50자 이내)]"
|
||||||
}
|
}
|
||||||
""".trimIndent()
|
""".trimIndent()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user