AI Definer is an API that allows you to get the definition of terms and phrases using the OpenAI chat completion API (model gpt-3.5-turbo
).
To use AI Definer, firstly set your OpenAI API key in a .env
file (see .env.example
).
Then, run the API using the following command :
go run .\main\main.go
The API will be available at http://localhost:8080/.
To compile the API, use the following command :
go build -o ai-definer.exe .\main\main.go
GET /definition/en/cake
{
"definition": "A sweet baked food made from a mixture of flour, sugar, eggs, and other ingredients, usually with a sweetening agent such as honey or sugar.",
"lang": "en",
"pronunciation": "keɪk",
"term": "cake",
"type": "noun"
}