【问题标题】:Getting Lex bot checksum value获取 Lex 机器人校验和值
【发布时间】:2020-06-18 23:45:35
【问题描述】:

我正在尝试使用 python SDK put_bot 函数更新 Lex 机器人。我需要传递指定here 的函数校验和值。我如何获得这个值? 到目前为止,我已经尝试使用以下函数以及从这些函数返回的校验和值

  1. 带有 prod 别名的 get_bot
  2. get_bot_alias 函数
  3. get_bot_aliases 函数

是校验和值

【问题讨论】:

    标签: amazon-web-services chatbot amazon-lex aws-lex


    【解决方案1】:

    Lex Model Building Service:

    校验和(字符串)-- 标识 $LATEST 版本的特定修订。

    创建新机器人时,请将校验和字段留空。如果你指定一个校验和,你会得到一个 BadRequestException 异常。

    当您要更新机器人时,请将校验和字段设置为 $LATEST 版本的最新修订版的校验和。如果您未指定校验和字段,或者校验和与 $LATEST 版本不匹配,则会收到 PreconditionFailedException 异常。

    如果你想更新它,你应该首先检索你的机器人的checksum

    您应该能够使用从get_bot_aliases() 返回的相同checksum

    这是来自get_bot_aliases() 函数的示例响应。

    {
        'BotAliases': [
            {
                'name': 'string',
                'description': 'string',
                'botVersion': 'string',
                'botName': 'string',
                'lastUpdatedDate': datetime(2015, 1, 1),
                'createdDate': datetime(2015, 1, 1),
                'checksum': 'string',                             --checksum here
                'conversationLogs': {
                    'logSettings': [
                        {
                            'logType': 'AUDIO'|'TEXT',
                            'destination': 'CLOUDWATCH_LOGS'|'S3',
                            'kmsKeyArn': 'string',
                            'resourceArn': 'string',
                            'resourcePrefix': 'string'
                        },
                    ],
                    'iamRoleArn': 'string'
                }
            },
        ],
        'nextToken': 'string'
    }
    

    【讨论】:

    • @AndyLon 我注意到您可能已经尝试过这样做。您应该包含与您尝试过的相关的相关代码和/或错误,因为此方法应该有效。
    【解决方案2】:

    如果你想更新intent,首先做get_intent并保存校验和并在put_intent中使用,如果你使用put_bot api,然后首先get_bot并将校验和保存在put_bot api中

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2022-01-12
      • 2018-02-18
      • 1970-01-01
      • 1970-01-01
      • 2016-04-30
      • 1970-01-01
      • 2021-01-24
      相关资源
      最近更新 更多