Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions core/shared/router/intent_router.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@ def intent_router(state: CustomsAgentState) -> CustomsAgentState:
2. tariff_prediction: 관세 계산, 세율 문의, 관세 예측 관련
3. qna: 일반적인 관세/통관 관련 질문, 법령 문의, 절차 안내

# 예시
- "관세 예측해줘" → tariff_prediction
- "관세 계산해줘" → tariff_prediction
- "관세 알려줘" → tariff_prediction
- "이 물건의 세금이 얼마나 나올까?" → tariff_prediction
- "운송장 번호 123456 어디쯤이야?" → customs_tracking
- "통관 진행 상황 알려줘" → customs_tracking
- "관세청 전화번호 알려줘" → qna
- "수입 절차가 궁금해" → qna

사용자 쿼리: {query}

반드시 다음 중 하나만 응답하세요: customs_tracking, tariff_prediction, qna
Expand All @@ -23,11 +33,11 @@ def intent_router(state: CustomsAgentState) -> CustomsAgentState:
SystemMessage(content=classification_prompt.format(query=state["query"]))
])

intent = result.content.strip()
intent = str(result.content).strip()
if intent not in ["customs_tracking", "tariff_prediction", "qna"]:
intent = "qna" # 기본값

state["intent"] = intent
# 타입 힌트에 맞게 Literal로 제한
state["intent"] = intent # type: ignore
state["messages"].append(AIMessage(content=f"의도 분류 완료: {intent}"))
print(state)
print(state) # type: ignore
return state