가드 문구 완화: 못 찾았다/사과/다른 곳 확인하세요 대신 가장 가까운 값+날짜 한 문장(추정 금지·숫자 근거 검사는 유지)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
kimandClaude Sonnet 5.5 committed 2026-10-20 00:13:27 +09:00
1 parent 0890085a2b
commit edfa1460cd
2 files changed
+3 -3

No files matched your search

+1 -1
View File
@@ -2149,7 +2149,7 @@ async function handleChat(
messages.push({ role: 'assistant', content: candidateText });
messages.push({
role: 'user',
content: `None of the figures you just gave (${_badFigures.join(', ')}) appear anywhere in the tool results from this turn — you produced them from memory, not from what you found. Rewrite the answer using ONLY numbers the tools actually returned. If the specific figure the user asked for is not in those results, say plainly that you could not find it, name what the results DID contain (which sources, what they were about), and give what IS known qualitatively — WITHOUT substituting an estimate. A stated range like "약 2~5" reads as a measurement to the user; do not offer one you cannot source. Do NOT open with an apology or "죄송합니다" — just give the corrected answer directly. The user never saw your previous draft: do not mention this correction, the draft, or the figures you removed — write the answer as if it were your first.`,
content: `None of the figures you just gave (${_badFigures.join(', ')}) appear anywhere in the tool results from this turn — you produced them from memory, not from what you found. Rewrite the answer using ONLY numbers the tools actually returned. If the specific figure the user asked for is not in those results, give the closest figure the results DID contain with its own date/scope in one sentence — WITHOUT substituting an estimate of your own. Do not list sources, do not say you could not find it, and do not suggest the user check elsewhere. A stated range like "약 2~5" reads as a measurement to the user; do not offer one you cannot source. Do NOT open with an apology or "죄송합니다" — just give the corrected answer directly. The user never saw your previous draft: do not mention this correction, the draft, or the figures you removed — write the answer as if it were your first.`,
});
lastRoundWasGuardReprompt = true;
continue;
+2 -2
View File
@@ -65,8 +65,8 @@ export interface SystemPromptInput {
*/
export function groundingResultReadingRule(dateStr: string): string {
return `You now have search results in front of you. Read them with these rules:
- A result reporting a "closing price" or "today's headline" is not proof today is a trading/business day — cross-check against the current date (${dateStr}). If they conflict, trust the current date and say so rather than presenting the result as live.
- Before treating any result as current, look for its own timestamp: a date in the URL (e.g. "tm=2024.12.13.20:00", "?date=..."), a dateline, or "as of ..." phrasing. If it is more than a day or two old, it is NOT "지금"/"현재" — say plainly that you could not find live data and name the stale date you found, instead of presenting old numbers as current. This applies to "is it raining right now" as much as to prices.
- A result reporting a "closing price" or "today's headline" is not proof today is a trading/business day — cross-check against the current date (${dateStr}). If they conflict, trust the current date and attach the result's date to the figure ("어제 마감 기준 …") rather than presenting it as live.
- Before treating any result as current, look for its own timestamp: a date in the URL (e.g. "tm=2024.12.13.20:00", "?date=..."), a dateline, or "as of ..." phrasing. If it is more than a day or two old, it is NOT "지금"/"현재" — state the figure together with its own date in the same sentence ("19일 마감 기준 1,330원"), instead of presenting old numbers as current. Do NOT announce that live data was unavailable, do not apologize, and do not tell the user to check another site — the dated figure alone is the answer. This applies to "is it raining right now" as much as to prices.
- When a result is a data TABLE (observation/measurement tables are the common case), read every row by its own row label, not by position. Misaligning one row's figures onto the next is worse than finding nothing, because it looks authoritative while being wrong. If you are not confident you are reading the right column for the right label, say so rather than guessing.
- If the results describe an older generation of a product than the user implies, say so and search again rather than reporting the old model as new.`;
}