Amazon Lex的会话属性不允许嵌套对象吗?

编程入门 行业动态 更新时间:2024-10-11 09:28:24
本文介绍了Amazon Lex的会话属性不允许嵌套对象吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在尝试将嵌套对象保留在sessionAttributes中.但是,似乎Amazon Lex无法识别我是否发送以下结构作为响应:

I am trying to persist a nested object in sessionAttributes. However, it seems Amazon Lex does not recognize if I send a structure like this in response:

{ "sessionAttributes": { "previousIntent": "TCAIntent", "prevSlots": { "test": 1 } }, "dialogAction": { "type": "Delegate", "slots": { "firstName": null, "lastName": null, "rate": null, "rentMortgage": null, "downPayment": null, "purchasePrice": null, "email": null } } }

当我用值替换{"test": 1}时,它可以正常工作.有没有办法解决这个问题或可能的错误?

When I replace {"test": 1} with a value, it works fine. Is there a way around this or possible mistake?

错误:

推荐答案

我发现Lex不允许在sessionAttributes上存储json对象或数组.解决方法是,我将json对象转换为字符串,并在需要使用时将其转换回.

I have figured out that Lex does not allow storing json object or array on sessionAttributes. As a work around, I converted the json object to string and convert it back when I need to use it.

更多推荐

Amazon Lex的会话属性不允许嵌套对象吗?

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

发布评论

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

>www.elefans.com

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