Advanced text encoding and decoding for OpenAI GPT-3 and GPT-4.
To install the package, run the following command:
npm install openai-encoder
Here's a simple example to get you started:
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}`);
Encodes the given text.
text
(String
): The text to encode.
String
: The encoded text.
Decodes the given encoded text.
encodedText
(String
): The text to decode.
String
: The decoded text.
To run tests, execute the following command:
npm run test
If you'd like to contribute, please fork the repository and use a feature branch. Pull requests are warmly welcome.
- Fork the repo
- Clone your fork
- Create a feature branch
- Make your changes
- Commit and push
- Create a new Pull Request
MIT License. See the LICENSE file for details.
Prasoon Thakur
- Website: prasoonthakur.com
Prasoon Thakur is the developer behind this package. For more information, projects, and contact, please visit prasoonthakur.com.