[Issue] Lambda LexEvent returns "null" values from Lex v2 Request

0

TL;DR: The "OrderFlowers" blueprint for Lex + Lambda on .NET Core 3.1 doesn't seem to work. Instead of populating the values for CurrentIntent and SlotDetails as expected, these values are null instead.

Note: Python and Node.js lambda equivalents seem to work just fine, but work use case requires .NET.


Context

  • Goal: Setup blueprint "OrderFlowers" chatbot with AWS Lex v2 using .NET Core 3.1 and AWS Lambda. (Link)
  • This may be an issue with Lex v2 rather than with Lambda, but this may be unlikely as Python and Node.js work fine when interchanged with the .NET lambda used.

Description

  • When invoking the OrderFlowers blueprint lambda function via AWS Lex, the LexEvent does not populate the expected fields, such as CurrentIntent and SlotDetails.
  • Compare this to using the Python or Node.js blueprints which do populate the expected fields.

Reproduction Steps

  1. Create a new .NET project using the "AWS Lambda Project (.NET Core - C#)" template with the "Order Flowers Chatbot" Blueprint.
  2. Log the lexEvent variable to CloudWatch within the FunctionHandler function: LambdaLogger.Log(JsonSerializer.Serialize(lexEvent));
  3. Publish the solution to AWS Lambda (default settings, arbitrary function name).
  4. Create a new Lex v2 Chatbot with the "Order Flowers Chatbot" Example.
  5. Configure the new chatbot to use the new lambda function you uploaded under Bot > Alias > Language.
  6. Under Intents > OrderFlowers > Fulfillment > Advanced Options, ensure "Use a Lambda function for fulfillment" is checked.
  7. Save the intent, build the bot, and test the conversation.
  8. An error should appear when attempting to fulfill the intent - when you check CloudWatch, the LexEvent body should appear with null values for fields such as CurrentIntent and SlotDetails.

Logs

Lex

Invalid Lambda Response: Received error response from Lambda: Unhandled

CloudWatch

{
    "CurrentIntent": null,
    "SlotDetails": null,
    "Bot": {
        "Name": "OrderFlowersBot",
        "Alias": null,
        "Version": "DRAFT"
    },
    "UserId": null,
    "InputTranscript": "yes",
    "InvocationSource": "FulfillmentCodeHook",
    "OutputDialogMode": null,
    "MessageVersion": "1.0",
    "SessionAttributes": null,
    "RequestAttributes": null,
    "AlternativeIntents": null,
    "SentimentResponse": null,
    "RecentIntentSummaryView": null,
    "ActiveContexts": null
}

Environment

  • Build Version: Amazon.Lambda.Core 2.1.0, Amazon.Lambda.LexEvents 3.0.0, Amazon.Lambda.Serialization.SystemText 2.2.0
  • OS Info: Windows 10 Enterprise
  • Build Environment: Visual Studio 2019
  • Targeted .NET Platform: .NET Core 3.1

Resolution

  • There may be an issue serializing the incoming request from Lex v2 based on the configuration laid out in the current Order Flowers .NET 3.1 blueprint. To resolve this, effort will need to be made comparing the expected Lex v2 request payload with the actual payload and the serialization may have to be adjusted accordingly.
답변 없음

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠