Skip to content

A Go API used to generate definitions of terms & phrases using the OpenAI chat completion API.

Notifications You must be signed in to change notification settings

PannH/ai-definer

Folders and files

NameName
Last commit message
Last commit date
Aug 19, 2024
Aug 19, 2024
Aug 19, 2024
Aug 19, 2024
Aug 19, 2024
Aug 19, 2024

Repository files navigation

AI Definer

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).

Usage

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

Example

Request

GET /definition/en/cake

Response

{
  "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"
}

About

A Go API used to generate definitions of terms & phrases using the OpenAI chat completion API.

Topics

Resources

Stars

Watchers

Forks

Languages