11package com.back.koreaTravelGuide.domain.ai.aiChat.tool
22
3- <<<<<<< HEAD
43import com.back.koreaTravelGuide.domain.ai.weather.service.WeatherService
54import com.back.koreaTravelGuide.domain.ai.weather.service.tools.Tools
6- ====== =
7- // TODO: AI 날씨 도구 - Spring AI @Tool 어노테이션으로 AI가 호출할 수 있는 날씨 기능
8- import com.back.koreaTravelGuide.domain.ai.weather.dto.MidForecastDto
9- import com.back.koreaTravelGuide.domain.ai.weather.dto.TemperatureAndLandForecastDto
10- import com.back.koreaTravelGuide.domain.ai.weather.service.WeatherService
11- >>>>>>> a51dd24 (feat(be): Add WeatherApiClientTest with ktlint compliance)
125import org.springframework.ai.tool.annotation.Tool
136import org.springframework.ai.tool.annotation.ToolParam
147import org.springframework.stereotype.Component
158
169@Component
1710class WeatherTool (
1811 private val weatherService : WeatherService ,
19- <<<<<<< HEAD
2012 private val tools : Tools ,
21- =======
22- >>>>>>> a51dd24 (feat(be): Add WeatherApiClientTest with ktlint compliance)
2313) {
2414 @Tool(description = " 전국 중기예보를 조회합니다" )
2515 fun getWeatherForecast (): String {
@@ -29,7 +19,6 @@ class WeatherTool(
2919 return forecasts?.toString() ? : " 중기예보 데이터를 가져올 수 없습니다."
3020 }
3121
32- <<<<<<< HEAD
3322 @Tool(description = " 특정 지역의 상세 기온 및 날씨 예보를 조회합니다" )
3423 fun getRegionalWeatherDetails (
3524 @ToolParam(description = " 지역명 (예: 서울, 부산, 대전, 제주 등)" , required = true )
@@ -40,29 +29,5 @@ class WeatherTool(
4029 val forecasts = weatherService.fetchTemperatureAndLandForecast(regionCode, actualBaseTime)
4130
4231 return forecasts?.toString() ? : " $location 지역의 상세 날씨 정보를 가져올 수 없습니다."
43- ====== =
44- @Tool(description = " 전국 중기전망 텍스트를 조회해 여행하기 좋은 지역 후보를 파악합니다. 먼저 호출하여 비교할 지역 코드를 추려 주세요." )
45- fun queryMidTermNarrative (
46- @ToolParam(description = " 발표 시각 (YYYYMMDDHHMM). 미지정 시 최근 발표시각 사용." , required = false ) baseTime : String? ,
47- ): List <MidForecastDto >? {
48- return weatherService.getWeatherForecast(
49- baseTime = baseTime,
50- )
51- }
52-
53- @Tool(description = " 중기 기온과 강수 확률 지표를 지역별로 조회합니다. 첫 번째 툴에서 제안한 지역 코드로 비교 분석에 사용하세요." )
54- fun queryMidTermAndLandForecastMetrics (
55- @ToolParam(description = " 지역 이름 (예: 서울, 인천)" , required = true ) location : String? ,
56- @ToolParam(description = " 중기예보 regId (예: [\" 11B10101\" , \" 11H20301\" ])." , required = true ) regionCode : String? ,
57- // @ToolParam(description = "중기예보 regId 배열 (예: [\"11B10101\", \"11H20301\"]).", required = true) regionCodes: List<String>,
58- @ToolParam(description = " 발표 시각 (YYYYMMDDHHMM). 미지정 시 최근 발표시각 사용." , required = false ) baseTime : String? ,
59- // @ToolParam(description = "확인할 일 수 offset 목록 (4~10). 비워 두면 4~10일 모두 반환.", required = false) days: List<Int>?,
60- ): List <TemperatureAndLandForecastDto >? {
61- return weatherService.getTemperatureAndLandForecast(
62- location = location,
63- regionCode = regionCode,
64- baseTime = baseTime,
65- )
66- >>>>>>> a51dd24 (feat(be): Add WeatherApiClientTest with ktlint compliance)
6732 }
6833}
0 commit comments