4단계: 봇 생성(AWS CLI) - Amazon Lex V1

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

 

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

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

4단계: 봇 생성(AWS CLI)

OrderFlowersBot 봇에는 이전 단계에서 생성한 OrderFlowers 의도 하나만 있습니다. 이 연습에서 명령을 실행하려면 명령이 실행될 리전을 알아야 합니다. 리전 목록은 모델 구축 할당량 을 참조하십시오.

참고

다음은 Unix, Linux, macOS용 형식으로 지정된 AWS CLI 예제입니다. Windows의 경우 "\$LATEST"$LATEST로 변경합니다.

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

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

    aws lex-models put-bot \ --region region \ --name OrderFlowersBot \ --cli-input-json file://OrderFlowersBot.json

    서버에서 다음과 같이 응답합니다. 봇을 생성하거나 업데이트하는 경우 status 필드가 BUILDING으로 설정됩니다. 이는 봇이 사용할 준비가 되지 않았음을 나타냅니다. 봇이 사용할 준비가 되었는지 확인하려면 다음 단계에서 GetBot 작업을 사용합니다.

    {
        "status": "BUILDING", 
        "intents": [
            {
                "intentVersion": "$LATEST", 
                "intentName": "OrderFlowers"
            }
        ], 
        "name": "OrderFlowersBot", 
        "locale": "en-US", 
        "checksum": "checksum", 
        "abortStatement": {
            "messages": [
                {
                    "content": "Sorry, I'm not able to assist at this time", 
                    "contentType": "PlainText"
                }
            ]
        }, 
        "version": "$LATEST", 
        "lastUpdatedDate": timestamp, 
        "createdDate": timestamp, 
        "clarificationPrompt": {
            "maxAttempts": 2, 
            "messages": [
                {
                    "content": "I didn't understand you, what would you like to do?", 
                    "contentType": "PlainText"
                }
            ]
        }, 
        "voiceId": "Salli", 
        "childDirected": false, 
        "idleSessionTTLInSeconds": 600, 
        "processBehavior": "BUILD",
        "description": "Bot to order flowers on the behalf of a user"
    }
    

  3. 새 봇이 사용할 준비가 되었는지 확인하려면 다음 명령을 실행합니다. status 필드가 READY를 반환할 때까지 이 명령을 반복 실행합니다. 다음은 Unix, Linux, macOS용 형식으로 지정된 예제입니다. Windows의 경우 각 줄의 끝에 있는 백슬래시(\) Unix 연속 문자를 캐럿(^)으로 바꿉니다.

    aws lex-models get-bot \ --region region \ --name OrderFlowersBot \ --version-or-alias "\$LATEST"

    응답에서 status 필드를 찾습니다.

    {
        "status": "READY", 
        
        ...
        
    }
    

다음 단계

5단계: 봇 테스트(AWS CLI)