Skip to content

πŸ‘©β€πŸ’» HNG9 Backend Stage 2 Task - A REST API with a POST endpoint that performs an arithmetic operation and returns a result.

License

Notifications You must be signed in to change notification settings

ChukwunonsoFrank/i9-backend-task-2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

HNG9 Backend Task(Stage 2)

πŸ‘©β€πŸ’» HNG9 Backend Stage 2 Task - A REST API with a POST endpoint that performs an arithmetic operation and returns a result.

Usage

Making a generic request:

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

Generic response in the terminal

Bonus(Describing the operation in words):

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

GPT-3 response in the terminal

License

Licensed under MIT License. Β© Kanu Frank Chukwunonso.

About

πŸ‘©β€πŸ’» HNG9 Backend Stage 2 Task - A REST API with a POST endpoint that performs an arithmetic operation and returns a result.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published