aws-samples / aws-samples/aws-lex-v2-bot-analytics
Error while receiving the response from lambda
- Dominant language
- Python
- Stars
- 14
- Forks
- 7
- PR merge metrics
- No merged PRs in 30d
Description
Hi, I used your code template, But I am getting the following error. This error is coming when lambda is sending response to lex.
``Invalid Lambda Response: Received invalid response from Lambda: Can not construct instance of AutoValue_Intent$Builder: no String-argument constructor/factory method to deserialize from String value ('Authorizations') at [Source: {"sessionState": {"sessionAttributes": {}, "dialogAction": {"type": "Close"}, "intent": "Authorizations"}, "messages": [{"contentType": "PlainText", "content": "Use\u00a0MyApps plus\u00a0(F5 VPN\u00a0is not needed.\u00a0VPN capacity is limited; therefore, it needs to be available for those who must access applications that are inaccessible through MyApps). After installation of MyApps plus, please restart PC before logging in to SteamERP. Log on is possible only through OneSteam ERP portal- https://onesteam.power.ge.com/irj/portal. Delete all cookies, histories and caches from browsers or try to access in different browsers. If your access was working from GE office, but is not working remotely, please contact your local IT support.\u00a0"}], "sessionId": "028857548531409", "requestAttributes": null}; line: 1, column: 89]` `
Here is the response I am creating from lambda:
```
ans = {
"sessionState": {
"sessionAttributes": session_attributes,
"dialogAction": {
"type": "Close"
},
"intent": str(intent_request['sessionState']['intent']['name'])
},
"messages": [message],
"sessionId": str(intent_request['sessionId']),
"requestAttributes": "Ignored"
}
```
I am not sure what is happening. I have checked double quotes and everything else.
Contributor guide
Research direction
Start with the response construction shown in the issue and compare sessionState.intent with the Lex V2 response schema, using the deserialization error as the first clue. Verify the corrected response through a Lex invocation; done means Lambda returns a response that Lex accepts without the AutoValue_Intent$Builder error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- aws, python
- Domain
- backend, cloud
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100