3단계: 의도 생성(AWS CLI) - Amazon Lex V1

Amazon Lex V2를 사용하는 경우 Amazon Lex V2 가이드를 대신 참조하십시오.

 

Amazon Lex V1을 사용하는 경우 봇을 Amazon Lex V2로 업그레이드하는하는 것이 좋습니다. 더 이상 V1에 새로운 기능을 추가하지 않으므로 모든 새 봇에 V2를 사용할 것을 강력히 권장합니다.

기계 번역으로 제공되는 번역입니다. 제공된 번역과 원본 영어의 내용이 상충하는 경우에는 영어 버전이 우선합니다.

3단계: 의도 생성(AWS CLI)

OrderFlowersBot 봇에 대한 의도를 생성하고 세 개의 슬롯 또는 파라미터를 제공합니다. 다음 슬롯은 봇이 의도를 이행하도록 합니다.

  • FlowerType은 주문 가능한 꽃의 종류를 지정하는 사용자 지정 슬롯 유형입니다.

  • AMAZON.DATEAMAZON.TIME은 사용자로부터 꽃 배송 날짜 및 시간을 얻는 데 사용되는 기본 제공 슬롯 유형입니다.

이 연습에서 명령을 실행하려면 명령이 실행될 리전을 알아야 합니다. 리전 목록은 모델 구축 할당량 을 참조하십시오.

OrderFlowers 의도를 생성하려면(AWS CLI)
  1. OrderFlowers.json라는 이름의 텍스트 파일을 만듭니다. OrderFlowers.json의 JSON 코드를 텍스트 파일에 복사합니다.

  2. AWS CLI에서 PutIntent 작업을 호출해 의도를 생성합니다. 다음은 Unix, Linux, macOS용 형식으로 지정된 예제입니다. Windows의 경우 각 줄의 끝에 있는 백슬래시(\) Unix 연속 문자를 캐럿(^)으로 바꿉니다.

    aws lex-models put-intent \ --region region \ --name OrderFlowers \ --cli-input-json file://OrderFlowers.json

    서버가 다음과 같이 응답합니다.

    {
        "confirmationPrompt": {
            "maxAttempts": 2, 
            "messages": [
                {
                    "content": "Okay, your {FlowerType} will be ready for pickup by {PickupTime} on {PickupDate}.  Does this sound okay?", 
                    "contentType": "PlainText"
                }
            ]
        }, 
        "name": "OrderFlowers", 
        "checksum": "checksum", 
        "version": "$LATEST", 
        "rejectionStatement": {
            "messages": [
                {
                    "content": "Okay, I will not place your order.", 
                    "contentType": "PlainText"
                }
            ]
        }, 
        "createdDate": timestamp, 
        "lastUpdatedDate": timestamp, 
        "sampleUtterances": [
            "I would like to pick up flowers", 
            "I would like to order some flowers"
        ], 
        "slots": [
            {
                "slotType": "AMAZON.TIME", 
                "name": "PickupTime", 
                "slotConstraint": "Required", 
                "valueElicitationPrompt": {
                    "maxAttempts": 2, 
                    "messages": [
                        {
                            "content": "Pick up the {FlowerType} at what time on {PickupDate}?", 
                            "contentType": "PlainText"
                        }
                    ]
                }, 
                "priority": 3, 
                "description": "The time to pick up the flowers"
            }, 
            {
                "slotType": "FlowerTypes", 
                "name": "FlowerType", 
                "slotConstraint": "Required", 
                "valueElicitationPrompt": {
                    "maxAttempts": 2, 
                    "messages": [
                        {
                            "content": "What type of flowers would you like to order?", 
                            "contentType": "PlainText"
                        }
                    ]
                }, 
                "priority": 1, 
                "slotTypeVersion": "$LATEST", 
                "sampleUtterances": [
                    "I would like to order {FlowerType}"
                ], 
                "description": "The type of flowers to pick up"
            }, 
            {
                "slotType": "AMAZON.DATE", 
                "name": "PickupDate", 
                "slotConstraint": "Required", 
                "valueElicitationPrompt": {
                    "maxAttempts": 2, 
                    "messages": [
                        {
                            "content": "What day do you want the {FlowerType} to be picked up?", 
                            "contentType": "PlainText"
                        }
                    ]
                }, 
                "priority": 2, 
                "description": "The date to pick up the flowers"
            }
        ], 
        "fulfillmentActivity": {
            "type": "ReturnIntent"
        }, 
        "description": "Intent to order a bouquet of flowers for pick up"
    }
    

다음 단계

4단계: 봇 생성(AWS CLI)