in source/services/lex-bot/leave_feedback/intent.py [0:0]
def create_slot(slot_name, slot_type_id, bot_id, locale_id, intent_id):
bot_language = os.environ.get("botLanguage")
slot_response = client.create_slot(
slotName=slot_name,
description=f"{slot_name} information.",
slotTypeId=slot_type_id,
valueElicitationSetting={
"slotConstraint": "Required",
"promptSpecification": {
"messageGroups": [
{
"message": {
"plainTextMessage": feedback_slot_messages(
bot_language, slot_name
)
}
},
],
"maxRetries": 5,
"allowInterrupt": True,
},
},
obfuscationSetting={"obfuscationSettingType": "None"},
botId=bot_id,
botVersion="DRAFT",
localeId=locale_id,
intentId=intent_id,
)
return slot_response["slotId"]