1.0.0 • Published 2 years ago
is-word-valid-ai v1.0.0
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-aiUse
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
2 years ago