diff --git a/app/prompts/search_synthesis.txt b/app/prompts/search_synthesis.txt index 45737d9..1b7be7f 100644 --- a/app/prompts/search_synthesis.txt +++ b/app/prompts/search_synthesis.txt @@ -14,7 +14,7 @@ Given a query and numbered evidence spans, write a short answer that cites speci } ## Rules -- `answer`: **400 characters max**. Must contain inline `[n]` citations. Every claim sentence ends with at least one `[n]`. Multiple sources: `[1][3]`. **Only use facts present in evidence. No outside knowledge, no guessing, no paraphrasing what is not there.** +- `answer`: **600 characters max**. Must contain inline `[n]` citations. Every claim sentence ends with at least one `[n]`. Multiple sources: `[1][3]`. **Only use facts present in evidence. No outside knowledge, no guessing, no paraphrasing what is not there.** - `used_citations`: integer list of `n` values that actually appear in `answer` (for cross-check). Must be sorted ascending, no duplicates. - `confidence`: - `high`: 3+ evidence items with strong relevance diff --git a/app/services/prompt_versions.py b/app/services/prompt_versions.py index 759c134..57c877d 100644 --- a/app/services/prompt_versions.py +++ b/app/services/prompt_versions.py @@ -17,7 +17,7 @@ from __future__ import annotations # ─── ask (/search/ask) 프롬프트 버전 ───────────────────────── # synthesis_service.py 가 로드하는 app/prompts/search_synthesis.txt 기준 -ASK_PROMPT_VERSION: str = "search_synthesis.v1-400char" +ASK_PROMPT_VERSION: str = "search_synthesis.v2-600char" # ─── /analyze 프롬프트 버전 ────────────────────────────────── # documents.py analyze 라우트가 로드하는 app/prompts/document_analyze.txt 기준 diff --git a/app/services/search/synthesis_service.py b/app/services/search/synthesis_service.py index 74ac125..51248a6 100644 --- a/app/services/search/synthesis_service.py +++ b/app/services/search/synthesis_service.py @@ -39,11 +39,11 @@ if TYPE_CHECKING: logger = setup_logger("synthesis") # ─── 상수 (plan 영구 룰) ───────────────────────────────── -PROMPT_VERSION = "v1" +PROMPT_VERSION = "v2" LLM_TIMEOUT_MS = 15000 CACHE_TTL = 3600 # 1h (answer 는 원문 변경에 민감 → query_analyzer 24h 보다 짧게) CACHE_MAXSIZE = 300 -MAX_ANSWER_CHARS = 400 +MAX_ANSWER_CHARS = 600 SynthesisStatus = Literal[ "completed",