Skip to content

Commit 27fb940

Browse files
committed
feat: 각 step 별로 필요한 정보가 없으면 추가 입력 요청
1 parent 7cdba7f commit 27fb940

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

core/tariff_prediction/agent/tariff_prediction_agent.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,8 @@ def handle_input_collection(self, user_input: str) -> str:
186186
scenario=self.state.get('scenario')
187187
)
188188
resp: TariffPredictionResponse = tariff_prediction_step_api(req)
189+
if resp.message and (not resp.hs6_candidates):
190+
return resp.message
189191
self.state['hs6_candidates'] = resp.hs6_candidates
190192
self.state['current_step'] = 'hs6_selection'
191193
return f"상품묘사: {parsed['product_name']}\n국가: {parsed['country']}\n가격: {parsed['price']:,}\n수량: {parsed.get('quantity', 1)}\n\nHS6 코드 후보를 찾았습니다. 번호를 선택해 주세요:\n" + '\n'.join([
@@ -217,6 +219,8 @@ def handle_hs6_selection(self, user_input: str) -> str:
217219
hs6_code=selected['code']
218220
)
219221
resp: TariffPredictionResponse = tariff_prediction_step_api(req)
222+
if resp.message and (not resp.hs10_candidates):
223+
return resp.message
220224
self.state['hs10_candidates'] = resp.hs10_candidates
221225
self.state['current_step'] = 'hs10_selection'
222226
return f"선택하신 HS6 코드: {selected['code']}\n\nHS10 코드 후보를 선택해 주세요:\n" + '\n'.join([

0 commit comments

Comments
 (0)