1.0.0 • Published 11 months ago

is-word-valid-ai v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

is-word-valid-ai

Check if a string is a valid word using AI

Install

yarn add is-word-valid-ai
# or
npm install is-word-valid-ai

Use

In order to use the package you must provide an Open AI API Key, for example

OPENAI_API_KEY={YOUR_API_KEY_HERE}

Example usage

import { isWordValid } from 'is-word-valid-ai' 

const response = await isWordValid('tomato', {
    key: process.env.OPENAI_MODEL,
    model: 'gpt-4o-mini',
    language: 'English'
})

console.log(response)

Response:

{
  "type": "noun",
  "isValid": true,
  "isPlural": false,
  "pluralValue": "tomatoes",
  "singularValue": "tomato",
  "description": "A round, red or yellow fruit that is used as a vegetable in cooking."
}
1.0.0

11 months ago