https://github.com/prasoonthakur8/openai-encoder
https://www.npmjs.com/package/openai-encoder 🔐 Advanced text encoding and decoding library optimized for OpenAI's GPT-3 and GPT-4. Designed for performance, reliability, and ease of use.
https://github.com/prasoonthakur8/openai-encoder
gpt-3 gpt-4 javascript npm-package openai text-decoding text-encoding
Last synced: 7 months ago
JSON representation
https://www.npmjs.com/package/openai-encoder 🔐 Advanced text encoding and decoding library optimized for OpenAI's GPT-3 and GPT-4. Designed for performance, reliability, and ease of use.
- Host: GitHub
- URL: https://github.com/prasoonthakur8/openai-encoder
- Owner: prasoonthakur8
- License: mit
- Created: 2023-10-24T11:18:14.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-05-18T00:23:22.000Z (over 1 year ago)
- Last Synced: 2024-05-18T01:26:29.029Z (over 1 year ago)
- Topics: gpt-3, gpt-4, javascript, npm-package, openai, text-decoding, text-encoding
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/openai-encoder
- Size: 8.79 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# OpenAI Encoder & Decoder
Advanced text encoding and decoding for OpenAI GPT-3 and GPT-4.


## Table of Contents
- [Installation](#installation)
- [Usage](#usage)
- [API](#api)
- [encode](#encode)
- [decode](#decode)
- [Testing](#testing)
- [Contributing](#contributing)
- [License](#license)
## Installation
To install the package, run the following command:
```bash
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
### `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:
```bash
npm run test
```
## Contributing
If you'd like to contribute, please fork the repository and use a feature branch. Pull requests are warmly welcome.
1. Fork the repo
2. Clone your fork
3. Create a feature branch
4. Make your changes
5. Commit and push
6. Create a new Pull Request
## License
MIT License. See the [LICENSE](LICENSE) file for details.
## About the Author
**Prasoon Thakur**
- Website: [prasoonthakur.com](https://prasoonthakur.com)
Prasoon Thakur is the developer behind this package. For more information, projects, and contact, please visit [prasoonthakur.com](https://prasoonthakur.com).