aws-samples / aws-samples/llm-apps-workshop

Magnum adapter issue in the lambda functions

Open
#5 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
HTML
Stars
113
Forks
35
PR merge metrics
No merged PRs in 30d

Description

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](https://stackoverflow.com/questions/63710044/keyerror-requestcontext-fastapi-mangum-serverless) that it can be related to the `magnum` adapter. Can this be fixed in the repo?

Thanks in advance.
/Reza

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.