create_slot_type
¶
create_slot_type(
slot_type_name: Name,
bot_id: Id,
bot_version: DraftBotVersion,
locale_id: LocaleId,
*,
config_overrides: Optional[LexModelsV2ClientConfig] = None,
description: Optional[Description] = None,
slot_type_values: Optional[SlotTypeValues] = None,
value_selection_setting: Optional[SlotValueSelectionSetting] = None,
parent_slot_type_signature: Optional[SlotTypeSignature] = None,
external_source_setting: Optional[ExternalSourceSetting] = None,
composite_slot_type_setting: Optional[CompositeSlotTypeSetting] = None,
) -> CreateSlotTypeResponse
Creates a custom slot type
To create a custom slot type, specify a name for the slot type and a set of enumeration values, the values that a slot of this type can assume.
Parameters:
-
slot_type_name(Name) –The name for the slot. A slot type name must be unique within the intent.
-
description(Optional[Description], default:None) –A description of the slot type. Use the description to help identify the slot type in lists.
-
slot_type_values(Optional[SlotTypeValues], default:None) –A list of
SlotTypeValueobjects that defines the values that the slot type can take. Each value can have a list of synonyms, additional values that help train the machine learning model about the values that it resolves for a slot. -
value_selection_setting(Optional[SlotValueSelectionSetting], default:None) –Determines the strategy that Amazon Lex uses to select a value from the list of possible values. The field can be set to one of the following values:
-
ORIGINAL_VALUE- Returns the value entered by the user, if the user value is similar to the slot value. -
TOP_RESOLUTION- If there is a resolution list for the slot, return the first value in the resolution list. If there is no resolution list, return null.
If you don't specify the
valueSelectionSettingparameter, the default isORIGINAL_VALUE. -
-
parent_slot_type_signature(Optional[SlotTypeSignature], default:None) –The built-in slot type used as a parent of this slot type. When you define a parent slot type, the new slot type has the configuration of the parent slot type.
Only
AMAZON.AlphaNumericis supported. -
bot_id(Id) –The identifier of the bot associated with this slot type.
-
bot_version(DraftBotVersion) –The identifier of the bot version associated with this slot type.
-
locale_id(LocaleId) –The identifier of the language and locale that the slot type will be used in. The string must match one of the supported locales. All of the bots, intents, and slots used by the slot type must have the same locale. For more information, see Supported languages.
-
external_source_setting(Optional[ExternalSourceSetting], default:None) –Sets the type of external information used to create the slot type.
-
composite_slot_type_setting(Optional[CompositeSlotTypeSetting], default:None) –Specifications for a composite slot type.
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/lex_models_v2.py
1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595 1596 1597 1598 1599 1600 1601 1602 1603 1604 1605 1606 1607 1608 1609 1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623 1624 1625 1626 1627 1628 1629 1630 1631 1632 1633 1634 1635 1636 1637 1638 1639 1640 1641 1642 1643 | |