in src/lambda_functions/bot_tester/lambda_function.py [0:0]
def handler(event, context):
"""Lambda Handler"""
# pylint: disable=unused-argument
LOGGER.info("bots config: %s", BOTS_CONFIG)
bot_logical_name = random.choice(BOT_NAMES) # nosec
locale_ids = BOTS_CONFIG[bot_logical_name]["localeIds"].split(",")
locale_id = random.choice(locale_ids) # nosec
bot_args = {
"botId": BOTS_CONFIG[bot_logical_name]["botId"],
"botAliasId": BOTS_CONFIG[bot_logical_name]["botAliasId"],
"localeId": locale_id,
}
LOGGER.info("bot: %s", bot_args)
session_id = context.aws_request_id
conversation = get_bot_conversation(bot_logical_name=bot_logical_name, locale=locale_id)
LOGGER.debug("conversation: %s", conversation)
responses = run_conversation_test(
bot_args=bot_args,
conversation=conversation,
session_id=session_id,
)
LOGGER.debug("responses: %s", responses)