openai-encoder
v1.0.3
Published
Advanced text encoding and decoding for Open AI | GPT-3 | GPT-4
Downloads
5
Readme
OpenAI Encoder & Decoder
Advanced text encoding and decoding for OpenAI GPT-3 and GPT-4.
Table of Contents
Installation
To install the package, run the following command:
npm install openai-encoder
Usage
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}`);
API
encode
Encodes the given text.
Parameters
text
(String
): The text to encode.
Returns
String
: The encoded text.
decode
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:
npm run test
Contributing
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
License
MIT License. See the LICENSE file for details.
About the Author
Anurag Deep
- Website: anuragdeep.com
Anurag Deep is the developer behind this package. For more information, projects, and contact, please visit anuragdeep.com.