날씨: 이미 내린 비 질문을 weather_kma type=past(어제 등 관측 일강수량)로 보내는 힌트 — 과거 조회는 이미 있었고 모델이 안 쓰던 것

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
kimandClaude Sonnet 5.5 committed 2026-10-19 10:04:10 +09:00
1 parent e82198fa77
commit 0091ce000b
3 files changed
+3 -3

No files matched your search

+1 -1
View File
@@ -939,7 +939,7 @@ export function createBuildTools(isOrchestrationSkillEnabled: () => boolean) {
// highs ran 1.5-2.5°C cooler (34.0 vs 36.5 for the same day), which matches its far
// denser domestic observation network. "current" is a real measurement, not a model
// estimate like the other two.
description: '한국 위치라면 이 도구를 먼저 쓸 것 (기상청 공식 API). type="current"는 관측 실황(기온·습도·풍향·풍속·강수형태) — 추정치가 아닌 실측값이라 국내에서 가장 신뢰도 높음. type="forecast"는 3일 단기예보(강수확률 포함). type="forecast"에는 날짜별 요약 외에 **시간별 예상 강수량(mm)과 합계, 3시간 간격 기온·습도·풍속·강수확률**이 포함되므로 "비 얼마나 와?", "내일 아침 몇 도야?", "오후에 바람 세?"도 이 도구 한 번으로 답할 것(기상청이 수치를 안 준다고 답하지 말 것). 이미 내린 비("이번 비 누적", "어제 온 비", "지금까지 온 비")는 forecast가 아니라 type="current"의 "이번 강수 누적"·"오늘 누적" 줄로 답할 것. type="current"에는 **앞으로 6시간 초단기예보**("한 시간 뒤 비 와?")가 붙는다. 한국 도시명을 그대로 넣으면 된다. 3일을 넘는 예보나 UV·시간별 상세가 필요하면 weather_openmeteo로 보완할 것. **미세먼지/초미세먼지/PM2.5/PM10/황사/대기질은 이 도구에 없음 — weather_airkorea를 쓸 것** (이 도구를 반복 호출해도 답이 안 나옴). 해외 지역에는 사용 불가.',
description: '한국 위치라면 이 도구를 먼저 쓸 것 (기상청 공식 API). type="current"는 관측 실황(기온·습도·풍향·풍속·강수형태) — 추정치가 아닌 실측값이라 국내에서 가장 신뢰도 높음. type="forecast"는 3일 단기예보(강수확률 포함). type="forecast"에는 날짜별 요약 외에 **시간별 예상 강수량(mm)과 합계, 3시간 간격 기온·습도·풍속·강수확률**이 포함되므로 "비 얼마나 와?", "내일 아침 몇 도야?", "오후에 바람 세?"도 이 도구 한 번으로 답할 것(기상청이 수치를 안 준다고 답하지 말 것). 이미 내린 비는 forecast로 답하지 말 것: "어제/그제/지난 …"은 type="past"+date(관측 일강수량), "이번 비 누적/지금까지"는 type="current"의 "이번 강수 누적"·"오늘 누적" 줄(없으면 past 어제 + 오늘 누적을 합쳐 제시). type="current"에는 **앞으로 6시간 초단기예보**("한 시간 뒤 비 와?")가 붙는다. 한국 도시명을 그대로 넣으면 된다. 3일을 넘는 예보나 UV·시간별 상세가 필요하면 weather_openmeteo로 보완할 것. **미세먼지/초미세먼지/PM2.5/PM10/황사/대기질은 이 도구에 없음 — weather_airkorea를 쓸 것** (이 도구를 반복 호출해도 답이 안 나옴). 해외 지역에는 사용 불가.',
parameters: {
type: 'object', required: ['location'],
properties: {
+1 -1
View File
@@ -35,7 +35,7 @@ export function weatherFollowUpHint(
const notes: string[] = [];
if (pastRain) {
notes.push('The user asks about rain that ALREADY fell (this rain event / yesterday / so far). Call weather_kma with type="current" (NOT "forecast") and answer from its "이번 강수 누적" line (cumulative since the rain began, with its start time and duration) and the "오늘 누적" line. Report those numbers directly and say which source each came from (e.g. AWS observation vs model estimate); do not say the amount cannot be determined when those lines are present, and never answer a past-rain question with forecast amounts.');
notes.push('The user asks about rain that ALREADY fell, so never answer with forecast amounts. (a) A specific past day ("어제", "그제", "지난 …", "간밤") → call weather_kma with type="past" and date="어제" (or the date; add endDate for a range) — it returns the observed daily total from the nearest ASOS station. (b) "이번 비 / 지금까지 온 비" → call weather_kma type="current" and use its "이번 강수 누적" and "오늘 누적" lines; if there is NO "이번 강수 누적" line (the rain stopped hours ago) also call type="past" date="어제" and give yesterday\'s total plus today\'s so-far amount, showing each. Always say which station/source each number came from; do not tell the user to look it up elsewhere when a tool can answer.');
}
if (TIME_BEFORE_GAJI.test(msg)) {
+1 -1
View File
@@ -37,7 +37,7 @@ test('history 끝에 현재 메시지가 이미 들어 있어도 직전 날씨
test('이미 내린 비(이번 비 누적/어제 온 비) → current 실황을 쓰라는 힌트', () => {
for (const q of ['현풍 이번 비 누적 강수량은?', '어제 온 비', '지금까지 온 비는?', '비 얼마나 왔어']) {
const h = weatherFollowUpHint(q, H);
assert.ok(h && /type="current"/.test(h), q);
assert.ok(h && /type="past"/.test(h) && /type="current"/.test(h), q);
}
});