aws-samples/llm-apps-workshop

Magnum adapter issue in the lambda functions

Opened this issue · 0 comments

Hi,

When I try to call the lambda function deployed by the stack (as explained in the readme)

curl -X POST "https://replace-with-your-api-gw-url/prod/api/v1/llm/rag" -H  "accept: application/json" -H  "Content-Type: application/json" -d "{\"q\":\"Which versions of XGBoost does SageMaker support?\"}"

I always get a 500 with the following log lines in the cloud watch:

{
  "errorMessage": "'requestContext'",
  "errorType": "KeyError",
  "requestId": "889fc5a4-07df-40f1-9c69-3725cca2046e",
  "stackTrace": [
    "  File \"/var/task/mangum/adapter.py\", line 110, in __call__\n    return self.handler(event, context)\n",
    "  File \"/var/task/mangum/adapter.py\", line 130, in handler\n    if \"eventType\" in event[\"requestContext\"]:\n"
  ]
}

It's pointed out here that it can be related to the magnum adapter. Can this be fixed in the repo?

Thanks in advance.
/Reza