Add an Item to a Slot Type¶
Identify SKILL_ID
and LOCALE
:
ask api list-skills \
| jq -r '.skills[] | "\([.nameByLocale[]][0]): \(.skillId) (\(.nameByLocale | keys[0]))"'
Add item:
ask api get-model --skill-id "${SKILL_ID}" --locale "${LOCALE}" \
| jq '(.interactionModel.languageModel.types[] | select(.name == "${TYPE_NAME}").values) += [{ "name": { "value": "${NEW_ITEM}" } }]'
Update skill model:
ask api update-model --skill-id "${SKILL_ID}" --locale "${LOCALE}" --file <(
ask api get-model --skill-id "${SKILL_ID}" --locale "${LOCALE}" \
| jq '(.interactionModel.languageModel.types[] | select(.name == "${TYPE_NAME}").values) += [{ "name": { "value": "${NEW_ITEM}" } }]'
)