How can I change the request body and the response in huggingface api using python

Hello everyone😁,
I want to make a web server where I have a app that request body is like this
{ "appPackageName": "", "messengerPackageName": "", "query": { "sender": "John Smith", "message": "This is an example!", "isGroup": false, "groupParticipant": "", "ruleId": 42 }

But the huggingface api request body is different so I want to change it using python and flask and the response body is also different so I just want to change it.

This is the response body I want
{ "replies": [ { "message": "Example reply 1" }