콘텐츠로 이동

카드 발급 신청 Slot

dm/scenario/card_issuance.json 기준의 slot registry와 수집 정책입니다.

전역 slots registry

Slot Policy Type Values 의미
name required string 신청자 이름
birth_date required string YYYY-MM-DD 형식 생년월일
card_type required enum standard, gold, platinum 신청 카드
annual_income required number 만원 단위 연소득
workplace required string 직장명 또는 근무 형태
employment_months required number 개월 단위 근무기간
postal_code required string 5자리 우편번호
address required string 기본 주소
detailed_address required string 상세 주소 또는 없음
delivery_option required enum standard, express 배송 방법
terms_agreed required enum yes, no 약관 동의
application_confirmed required enum yes, no 최종 신청 확인

전역 slots는 정의 registry이고, 실제 수집 범위와 순서는 각 node의 collect_slots가 결정합니다.

노드별 수집 대상

Node collect_slots Executor
welcome GeneralResponseExecutor
collect_personal_info name, birth_date TaskOrientedExecutor
select_card_type card_type TaskOrientedExecutor
income_verification annual_income, workplace, employment_months TaskOrientedExecutor
address_collection postal_code, address, detailed_address, delivery_option TaskOrientedExecutor
final_confirmation terms_agreed TaskOrientedExecutor
process_application application_confirmed TaskOrientedExecutor
결과·취소 node GeneralResponseExecutor

collect_slots 배열 순서가 NLU prompt의 수집 순서와 missing slot 질문 순서에 영향을 줍니다.

Required 정책

모든 slot이 required입니다.

상태 Task policy 동작
required slot 미수집 blocking_missing에 포함하고 현재 node 유지
required slot 모두 수집 node condition 또는 default_next 평가
max_turns까지 미수집 required_slot_not_collected, 세션 종료 가능
사용자가 취소 global transition이 slot 수집보다 우선

Optional slot이 없으므로 사용자가 “모르겠다”고 답해도 optional 포기 경로로 정상 진행하지 않습니다.

개인정보 slot

name

사용자 이름을 문자열로 저장합니다.

현재 정규식이나 길이 제한은 없습니다. 이름처럼 보이는지 여부는 NLU 판단에 의존합니다.

birth_date

NLU prompt는 YYYY-MM-DD로 정규화하도록 지시합니다.

1990년 5월 3일 → 1990-05-03

현재 runtime이 검사하지 않는 항목:

검증 현재 상태
YYYY-MM-DD 정규식 미검증
실제 존재하는 날짜 미검증
미래 날짜 여부 미검증
신청 가능 연령 미검증

value_type=string과 description은 NLU metadata이며 state 저장 검증기가 아닙니다.

주소

Slot 규칙
postal_code 앞자리 0을 보존하기 위해 string
address 기본 주소
detailed_address 상세주소가 없으면 없음

Scenario prompt는 최종 확인에서 전체 주소를 그대로 반복하지 않도록 지시합니다. 실제 저장 단계에서 마스킹하거나 암호화하지는 않습니다.

Enum 정규화

card_type

사용자 표현 저장 값
일반카드, 일반, 1번 standard
골드카드, 골드, 2번 gold
플래티넘카드, 플래티넘, 3번 platinum

delivery_option

사용자 표현 저장 값
일반배송, 무료배송, 1번 standard
빠른배송, 특급배송, 2번 express

동의 slot

문맥 긍정 부정
약관 동의 terms_agreed=yes terms_agreed=no
최종 신청 확인 application_confirmed=yes application_confirmed=no

짧은 “네”, “아니요”는 직전 봇 질문을 확인한 뒤 현재 node의 slot 하나에만 반영해야 합니다.

숫자 정규화

annual_income

단위는 만원입니다.

사용자 표현 NLU 출력
5천만원 "5000"
3,500만 원 "3500"
소득 없음 "0"

employment_months

사용자 표현 NLU 출력
2년 3개월 "27"
6개월 "6"
현재 근무기간 없음 "0"

Slot schema의 value_type은 number이지만 NLU가 숫자 문자열을 반환할 수 있습니다. Routing의 greater_thanless_thanfloat() 변환을 수행하므로 숫자 문자열도 비교됩니다.

숫자 0 주의점

SlotUpdatePolicy는 entity value가 truthy일 때만 slot update를 만듭니다.

0    → falsey, 저장되지 않을 수 있음
"0"  → truthy, 저장됨

그래서 Scenario NLU prompt는 소득이나 근무기간이 0일 때 숫자 0이 아니라 문자열 "0"을 반환하도록 지시합니다.

Routing에서 사용하는 slot

취소

terms_agreed == no
→ application_cancelled

application_confirmed == no
→ application_cancelled

승인

card_type == standard
AND annual_income > 1999
AND employment_months > 5
→ completion_approved

Gold와 platinum도 같은 구조로 각각 3499, 7999를 기준으로 사용합니다.

거절

employment_months < 6
OR 선택 카드의 annual_income 기준 미달
→ completion_rejected

승인·거절은 모든 수집 단계와 최종 신청 확인을 마친 뒤 process_application에서 평가합니다.

Slot 저장 경로

Source 설명
nlu 현재 수집 대상 entity
nlu_auto 현재 node 대상 밖에서 함께 추출한 새 entity
nlu_refilled 이미 존재하는 slot을 NLU가 다시 추출
affirm_inferred entity 없는 짧은 긍정에서 추론
deny_inferred entity 없는 짧은 부정에서 추론

현재 runtime은 collect_slots 밖 entity도 저장할 수 있습니다. Scenario의 “현재 node 대상만 entities에 넣는다”는 NLU 지침이 중요합니다.

검증 제약

현재 runtime은 다음을 state 저장 시 강제하지 않습니다.

  • value_type 일치
  • enum values membership
  • 생년월일 형식과 실제 날짜
  • 우편번호 길이
  • 금액·기간 범위

실제 서비스에서 엄격한 검증이 필요하면 NLU 추출과 slot commit 사이에 slot별 validator를 구현해야 합니다. 검증 실패 값은 저장하지 않고 해당 required slot을 계속 missing 상태로 유지해야 합니다.

관련 문서