:doc:`LexModelBuildingService <../../lex-models>` / Client / get_bot

*******
get_bot
*******



.. py:method:: LexModelBuildingService.Client.get_bot(**kwargs)

  

  Returns metadata information for a specific bot. You must provide the bot name and the bot version or alias.

   

  This operation requires permissions for the ``lex:GetBot`` action.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/lex-models-2017-04-19/GetBot>`_  


  **Request Syntax**
  ::

    response = client.get_bot(
        name='string',
        versionOrAlias='string'
    )
    
  :type name: string
  :param name: **[REQUIRED]** 

    The name of the bot. The name is case sensitive.

    

  
  :type versionOrAlias: string
  :param versionOrAlias: **[REQUIRED]** 

    The version or alias of the bot.

    

  
  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'name': 'string',
          'description': 'string',
          'intents': [
              {
                  'intentName': 'string',
                  'intentVersion': 'string'
              },
          ],
          'enableModelImprovements': True|False,
          'nluIntentConfidenceThreshold': 123.0,
          'clarificationPrompt': {
              'messages': [
                  {
                      'contentType': 'PlainText'|'SSML'|'CustomPayload',
                      'content': 'string',
                      'groupNumber': 123
                  },
              ],
              'maxAttempts': 123,
              'responseCard': 'string'
          },
          'abortStatement': {
              'messages': [
                  {
                      'contentType': 'PlainText'|'SSML'|'CustomPayload',
                      'content': 'string',
                      'groupNumber': 123
                  },
              ],
              'responseCard': 'string'
          },
          'status': 'BUILDING'|'READY'|'READY_BASIC_TESTING'|'FAILED'|'NOT_BUILT',
          'failureReason': 'string',
          'lastUpdatedDate': datetime(2015, 1, 1),
          'createdDate': datetime(2015, 1, 1),
          'idleSessionTTLInSeconds': 123,
          'voiceId': 'string',
          'checksum': 'string',
          'version': 'string',
          'locale': 'de-DE'|'en-AU'|'en-GB'|'en-IN'|'en-US'|'es-419'|'es-ES'|'es-US'|'fr-FR'|'fr-CA'|'it-IT'|'ja-JP'|'ko-KR',
          'childDirected': True|False,
          'detectSentiment': True|False
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **name** *(string) --* 

        The name of the bot.

        
      

      - **description** *(string) --* 

        A description of the bot.

        
      

      - **intents** *(list) --* 

        An array of ``intent`` objects. For more information, see  PutBot.

        
        

        - *(dict) --* 

          Identifies the specific version of an intent.

          
          

          - **intentName** *(string) --* 

            The name of the intent.

            
          

          - **intentVersion** *(string) --* 

            The version of the intent.

            
      
    
      

      - **enableModelImprovements** *(boolean) --* 

        Indicates whether the bot uses accuracy improvements. ``true`` indicates that the bot is using the improvements, otherwise, ``false``.

        
      

      - **nluIntentConfidenceThreshold** *(float) --* 

        The score that determines where Amazon Lex inserts the ``AMAZON.FallbackIntent``, ``AMAZON.KendraSearchIntent``, or both when returning alternative intents in a `PostContent <https://docs.aws.amazon.com/lex/latest/dg/API_runtime_PostContent.html>`__ or `PostText <https://docs.aws.amazon.com/lex/latest/dg/API_runtime_PostText.html>`__ response. ``AMAZON.FallbackIntent`` is inserted if the confidence score for all intents is below this value. ``AMAZON.KendraSearchIntent`` is only inserted if it is configured for the bot.

        
      

      - **clarificationPrompt** *(dict) --* 

        The message Amazon Lex uses when it doesn't understand the user's request. For more information, see  PutBot.

        
        

        - **messages** *(list) --* 

          An array of objects, each of which provides a message string and its type. You can specify the message string in plain text or in Speech Synthesis Markup Language (SSML).

          
          

          - *(dict) --* 

            The message object that provides the message text and its type.

            
            

            - **contentType** *(string) --* 

              The content type of the message string.

              
            

            - **content** *(string) --* 

              The text of the message.

              
            

            - **groupNumber** *(integer) --* 

              Identifies the message group that the message belongs to. When a group is assigned to a message, Amazon Lex returns one message from each group in the response.

              
        
      
        

        - **maxAttempts** *(integer) --* 

          The number of times to prompt the user for information.

          
        

        - **responseCard** *(string) --* 

          A response card. Amazon Lex uses this prompt at runtime, in the ``PostText`` API response. It substitutes session attributes and slot values for placeholders in the response card. For more information, see  ex-resp-card.

          
    
      

      - **abortStatement** *(dict) --* 

        The message that Amazon Lex returns when the user elects to end the conversation without completing it. For more information, see  PutBot.

        
        

        - **messages** *(list) --* 

          A collection of message objects.

          
          

          - *(dict) --* 

            The message object that provides the message text and its type.

            
            

            - **contentType** *(string) --* 

              The content type of the message string.

              
            

            - **content** *(string) --* 

              The text of the message.

              
            

            - **groupNumber** *(integer) --* 

              Identifies the message group that the message belongs to. When a group is assigned to a message, Amazon Lex returns one message from each group in the response.

              
        
      
        

        - **responseCard** *(string) --* 

          At runtime, if the client is using the `PostText <http://docs.aws.amazon.com/lex/latest/dg/API_runtime_PostText.html>`__ API, Amazon Lex includes the response card in the response. It substitutes all of the session attributes and slot values for placeholders in the response card.

          
    
      

      - **status** *(string) --* 

        The status of the bot.

         

        When the status is ``BUILDING`` Amazon Lex is building the bot for testing and use.

         

        If the status of the bot is ``READY_BASIC_TESTING``, you can test the bot using the exact utterances specified in the bot's intents. When the bot is ready for full testing or to run, the status is ``READY``.

         

        If there was a problem with building the bot, the status is ``FAILED`` and the ``failureReason`` field explains why the bot did not build.

         

        If the bot was saved but not built, the status is ``NOT_BUILT``.

        
      

      - **failureReason** *(string) --* 

        If ``status`` is ``FAILED``, Amazon Lex explains why it failed to build the bot.

        
      

      - **lastUpdatedDate** *(datetime) --* 

        The date that the bot was updated. When you create a resource, the creation date and last updated date are the same.

        
      

      - **createdDate** *(datetime) --* 

        The date that the bot was created.

        
      

      - **idleSessionTTLInSeconds** *(integer) --* 

        The maximum time in seconds that Amazon Lex retains the data gathered in a conversation. For more information, see  PutBot.

        
      

      - **voiceId** *(string) --* 

        The Amazon Polly voice ID that Amazon Lex uses for voice interaction with the user. For more information, see  PutBot.

        
      

      - **checksum** *(string) --* 

        Checksum of the bot used to identify a specific revision of the bot's ``$LATEST`` version.

        
      

      - **version** *(string) --* 

        The version of the bot. For a new bot, the version is always ``$LATEST``.

        
      

      - **locale** *(string) --* 

        The target locale for the bot.

        
      

      - **childDirected** *(boolean) --* 

        For each Amazon Lex bot created with the Amazon Lex Model Building Service, you must specify whether your use of Amazon Lex is related to a website, program, or other application that is directed or targeted, in whole or in part, to children under age 13 and subject to the Children's Online Privacy Protection Act (COPPA) by specifying ``true`` or ``false`` in the ``childDirected`` field. By specifying ``true`` in the ``childDirected`` field, you confirm that your use of Amazon Lex **is** related to a website, program, or other application that is directed or targeted, in whole or in part, to children under age 13 and subject to COPPA. By specifying ``false`` in the ``childDirected`` field, you confirm that your use of Amazon Lex **is not** related to a website, program, or other application that is directed or targeted, in whole or in part, to children under age 13 and subject to COPPA. You may not specify a default value for the ``childDirected`` field that does not accurately reflect whether your use of Amazon Lex is related to a website, program, or other application that is directed or targeted, in whole or in part, to children under age 13 and subject to COPPA.

         

        If your use of Amazon Lex relates to a website, program, or other application that is directed in whole or in part, to children under age 13, you must obtain any required verifiable parental consent under COPPA. For information regarding the use of Amazon Lex in connection with websites, programs, or other applications that are directed or targeted, in whole or in part, to children under age 13, see the `Amazon Lex FAQ. <https://aws.amazon.com/lex/faqs#data-security>`__

        
      

      - **detectSentiment** *(boolean) --* 

        Indicates whether user utterances should be sent to Amazon Comprehend for sentiment analysis.

        
  
  **Exceptions**
  
  *   :py:class:`LexModelBuildingService.Client.exceptions.NotFoundException`

  
  *   :py:class:`LexModelBuildingService.Client.exceptions.LimitExceededException`

  
  *   :py:class:`LexModelBuildingService.Client.exceptions.InternalFailureException`

  
  *   :py:class:`LexModelBuildingService.Client.exceptions.BadRequestException`

  

  **Examples**

  This example shows how to get configuration information for a bot.
  ::

    response = client.get_bot(
        name='DocOrderPizza',
        versionOrAlias='$LATEST',
    )
    
    print(response)

  
  Expected Output:
  ::

    {
        'version': '$LATEST',
        'name': 'DocOrderPizzaBot',
        'abortStatement': {
            'messages': [
                {
                    'content': 'I don't understand. Can you try again?',
                    'contentType': 'PlainText',
                },
                {
                    'content': 'I'm sorry, I don't understand.',
                    'contentType': 'PlainText',
                },
            ],
        },
        'checksum': '20172ee3-fa06-49b2-bbc5-667c090303e9',
        'childDirected': True,
        'clarificationPrompt': {
            'maxAttempts': 1,
            'messages': [
                {
                    'content': 'I'm sorry, I didn't hear that. Can you repeate what you just said?',
                    'contentType': 'PlainText',
                },
                {
                    'content': 'Can you say that again?',
                    'contentType': 'PlainText',
                },
            ],
        },
        'createdDate': 1494360160.133,
        'description': 'Orders a pizza from a local pizzeria.',
        'idleSessionTTLInSeconds': 300,
        'intents': [
            {
                'intentName': 'DocOrderPizza',
                'intentVersion': '$LATEST',
            },
        ],
        'lastUpdatedDate': 1494360160.133,
        'locale': 'en-US',
        'status': 'NOT_BUILT',
        'ResponseMetadata': {
            '...': '...',
        },
    }

  