Advanced text encoding and decoding for Open AI | GPT-3 | GPT-4
npm install openai-encoderbash
npm install openai-encoder
`
Usage
Here's a simple example to get you started:
`javascript
const encoder = require('openai-encoder/src/encoder');
const decoder = require('openai-encoder/src/decoder');
const originalText = 'This is a test string.';
const encodedText = encoder.encode(originalText);
const decodedText = decoder.decode(encodedText);
console.log(Original Text: ${originalText});
console.log(Encoded Text: ${encodedText});
console.log(Decoded Text: ${decodedText});
`
API
$3
Encodes the given text.
#### Parameters
- text (String): The text to encode.
#### Returns
- String: The encoded text.
$3
Decodes the given encoded text.
#### Parameters
- encodedText (String): The text to decode.
#### Returns
- String: The decoded text.
Testing
To run tests, execute the following command:
`bash
npm run test
``