π©βπ» HNG9 Backend Stage 2 Task - A REST API with a POST endpoint that performs an arithmetic operation and returns a result.
In this example, we are using the curl
command line tool to make a request with the operation_type
Enum and the two integers the operation will be performed on, x
and y
.
curl -d '{"operation_type": {"value": "addition"}, "x": 10, "y": 10}' -H 'Content-Type: application/json' https://hng9-backend-task-2.onrender.com/v1/operation/compute
Here, we describe the operation we want to execute in a sentence and pass it as a string in the operation_type
parameter of the request body. This feature is powered by the OpenAI GPT-3 API via the text-davinci-002
model.
curl -d '{"operation_type": "Can you please add 4 and 5 for me?"}' -H 'Content-Type: application/json' https://hng9-backend-task-2.onrender.com/v1/operation/compute
Licensed under MIT License. Β© Kanu Frank Chukwunonso.