Awslambda is not defined - using serve in Netlify Function

Just added @netlify/functions to my project to use for calling OpenAI, but getting an error when using the 2nd example from the docs here - Lambda compatibility for Functions | Netlify Docs

Checked netllify/functions/dist/lib/stream in node modules and don’t see awslambda being imported?

api | /Users/hamishirving/Documents/Personal/Projects/CareBridge/care-bridge-rw/node_modules/@netlify/functions/dist/lib/stream.js:39
api | const stream = (handler) => awslambda.streamifyResponse(async (event, responseStream, context) => {
api |                                       ^
api | 
api | ReferenceError: awslambda is not defined
api |     at stream (/Users/hamishirving/Documents/Personal/Projects/CareBridge/care-bridge-rw/node_modules/@netlify/functions/dist/lib/stream.js:39:39)
api |     at Object.<anonymous> (/Users/hamishirving/Documents/Personal/Projects/CareBridge/care-bridge-rw/api/src/functions/chat/chat.js:31:19)
api |     at Module._compile (node:internal/modules/cjs/loader:1241:14)
api |     at Module._extensions..js (node:internal/modules/cjs/loader:1295:10)
api |     at Module.load (node:internal/modules/cjs/loader:1091:32)
api |     at Module._load (node:internal/modules/cjs/loader:938:12)
api |     at Module.require (node:internal/modules/cjs/loader:1115:19)
api |     at require (node:internal/modules/helpers:130:18)
api |     at /Users/hamishirving/Documents/Personal/Projects/CareBridge/care-bridge-rw/node_modules/@redwoodjs/api-server/dist/plugins/lambdaLoader.js:35:11
api |     at new Promise (<anonymous>)
api | 
api | Node.js v20.9.0

While it would be useful to investigate the error, is there a particular reason to use that instead of the new API: Get started with functions | Netlify Docs?

At the same time, that piece of code is exactly how AWS documents it: Introducing AWS Lambda response streaming | AWS Compute Blog (, so I don’t think there’s any issue from our end here. What version of Netlify CLI are you using?