使用Amazon Lex的inputTranscript允许一个宽阔的插槽

编程入门 行业动态 更新时间:2024-10-10 17:23:03
本文介绍了使用Amazon Lex的inputTranscript允许一个宽阔的插槽的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

任何人都可以提供关于如何确切地使用inputTranscript lex事件将输入作为值返回给插槽的信息,以允许使用开放的插槽类型吗?我可以捕获用户输入没问题,它只是将它作为遇到问题的插槽值发送回去.从研究中可以看出,这是完成将任何值接受到插槽中的能力的最佳方法.我只是似乎无法真正使它工作.我已经阅读了几篇有关创建插槽的文章,然后使用了elicit插槽功能,但是其中没有什么非常详细的. 谢谢

Can anyone provide any insight on exactly how to use the inputTranscript lex event to feed that input back to a slot as its value, to allow for an open slot type? I can capture the user input no problem, its just sending it back as the slot value where I'm encountering issues. From what I can see from researching, this is the best way to accomplish the ability to accept any value into a slot. I just cant seem to be able to actually get it to work. I've read a few posts stating to create the slot, then use the elicit slot function but nothing out there is very detailed. Thanks

推荐答案

假设您的意图中有一个插槽anyString. 您需要做的第一件事就是取消选中此插槽的必需复选框. 现在,在选项中,选择Initialization and validation code hook并选择Lambda函数. 在DialogCodeHook中,我们可以使用以下代码来获取用户输入并将其分配到插槽anyString中:

Suppose you have a slot anyString in your intent. First thing you need to do is uncheck the required checkbox for this slot. Now in Options, choose Initialization and validation code hook and select your Lambda function. IN DialogCodeHook we can grab the user input and assign it to our slot anyString using below code:

slots = intent_request['currentIntent']['slots'] slots['anyString'] = intent_request['inputTranscript']

您可以阅读有关dialogAction的更多信息这里.

You can read more about dialogAction here.

希望有帮助.

更多推荐

使用Amazon Lex的inputTranscript允许一个宽阔的插槽

本文发布于:2023-11-28 06:01:51,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1641217.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:插槽   宽阔   Amazon   Lex   inputTranscript

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!