The purpose of this package is to translate the natural language generated by OpenAI's GPT models or any other large language models into JavaScript data types like booleans and objects.
Install the package from NPM
npm i gpt-logic
Import the package
const GPTLogic = require('gpt-logic');
Instantiate a GPTLogic object
const gptLogic = new GPTLogic('YOUR_PROVIDER', 'MODEL_NAME', 'CREDENTIAL');
Currently, the following providers and models are supported:
- OpenAI
-
- gpt-3.5-turbo
-
- gpt-4
This example calls the isTrue
function:
const call = async () => {
const result = await gptLogic.isTrue(`The earth is flat`);
console.log(JSON.stringify(result));
};
call();
And you will expect the following response:
{ "hasDetermined": true, "result": false }
- isTrue
- getNumbers