create_slot
async
¶
create_slot(
slot_name: Name,
value_elicitation_setting: SlotValueElicitationSetting,
bot_id: Id,
bot_version: DraftBotVersion,
locale_id: LocaleId,
intent_id: Id,
*,
config_overrides: Optional[AsyncLexModelsV2ClientConfig] = None,
description: Optional[Description] = None,
slot_type_id: Optional[BuiltInOrCustomSlotTypeId] = None,
obfuscation_setting: Optional[ObfuscationSetting] = None,
multiple_values_setting: Optional[MultipleValuesSetting] = None,
sub_slot_setting: Optional[SubSlotSetting] = None,
) -> CreateSlotResponse
Creates a slot in an intent. A slot is a variable needed to fulfill an intent. For example, an OrderPizza intent might need slots for size, crust, and number of pizzas. For each slot, you define one or more utterances that Amazon Lex uses to elicit a response from the user.
Parameters:
-
slot_name(Name) –The name of the slot. Slot names must be unique within the bot that contains the slot.
-
description(Optional[Description], default:None) –A description of the slot. Use this to help identify the slot in lists.
-
slot_type_id(Optional[BuiltInOrCustomSlotTypeId], default:None) –The unique identifier for the slot type associated with this slot. The slot type determines the values that can be entered into the slot.
-
value_elicitation_setting(SlotValueElicitationSetting) –Specifies prompts that Amazon Lex sends to the user to elicit a response that provides the value for the slot.
-
obfuscation_setting(Optional[ObfuscationSetting], default:None) –Determines how slot values are used in Amazon CloudWatch logs. If the value of the
obfuscationSettingparameter isDefaultObfuscation, slot values are obfuscated in the log output. If the value isNone, the actual value is present in the log output.The default is to obfuscate values in the CloudWatch logs.
-
bot_id(Id) –The identifier of the bot associated with the slot.
-
bot_version(DraftBotVersion) –The version of the bot associated with the slot.
-
locale_id(LocaleId) –The identifier of the language and locale that the slot will be used in. The string must match one of the supported locales. All of the bots, intents, slot types used by the slot must have the same locale. For more information, see Supported languages.
-
intent_id(Id) –The identifier of the intent that contains the slot.
-
multiple_values_setting(Optional[MultipleValuesSetting], default:None) –Indicates whether the slot returns multiple values in one response. Multi-value slots are only available in the
en-USlocale. If you set this value totruein any other locale, Amazon Lex throws aValidationException.If the
multipleValuesSettingis not set, the default value isfalse. -
sub_slot_setting(Optional[SubSlotSetting], default:None) –Specifications for the constituent sub slots and the expression for the composite slot.
Raises:
-
ConflictException–The action that you tried to perform couldn't be completed because the resource is in a conflicting state. For example, deleting a bot that is in the CREATING state. Try your request again.
-
InternalServerException–The service encountered an unexpected condition. Try your request again.
-
PreconditionFailedException–Your request couldn't be completed because one or more request fields aren't valid. Check the fields in your request and try again.
-
ServiceQuotaExceededException–You have reached a quota for your bot.
-
ThrottlingException–Your request rate is too high. Reduce the frequency of requests.
-
ValidationException–One of the input parameters in your request isn't valid. Check the parameters and try your request again.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_lex_models_v2/_services/async_lex_models_v2.py
1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502 1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 | |