Set lambda function based on stage variable

I’ve followed the guide at Using API Gateway stage variables to manage Lambda functions | AWS Compute Blog and manually set my Lambda function to be a stage variable like the following:

However I can’t figure out how I can do the same from within my serverless configuration is there any way to do this?

Stages in the Serverless Framework are very different to stages in the API Gateway. Unless you know what you’re doing and you have a very strong need for them I would stay away from API Gateway stages (beyond what serverless does automatically) and use the Serverless Framework stages instead.