Repository navigation
1.0.0
Release Notes - Version 1.0.0
YZhanJSONTranslater
Release Date: October 4, 2024
New Features
-
JSON Translation with OpenAI:
- Translates the values of a JSON object to different languages while keeping the keys unchanged.
- Supports multiple languages using OpenAI's GPT-4 models.
-
Customizable API Client Configuration:
- Ability to configure OpenAI client settings, including API key, organization ID, and API URL.
-
Caching Mechanism:
- File-based caching: Reduce API calls and costs by caching translated results.
- Cache customization:
- Cache type: Currently supports
File-based caching. - Cache parameters: Specify cache directory using the
params['dir']field. - Cache expiration: Set cache expiration time in seconds using the
maxAgefield to control how long cache is valid.
- Cache type: Currently supports
-
Environment Variables Support:
- Configure OpenAI credentials through environment variables (
OPENAI_APIKEY,OPENAI_APIURL,OPENAI_ORGANIZATION).
- Configure OpenAI credentials through environment variables (
Enhancements
- Improved API request efficiency by utilizing caching mechanisms.
- Enhanced translation accuracy and flexibility with OpenAI GPT-4 integration.
- Detailed cache control options for optimized API usage and response time.
Testing & Developer Tools
-
PHPUnit Integration:
- Unit tests for translation functionality.
- Cache-related test cases to ensure cache behavior works as expected.
-
Composer Scripts:
test: Run unit tests usingphpunit.coverage: Generate test coverage reports.
Requirements
- PHP 5.4 or above.
- OpenAI API key and organization ID.
- Composer for managing dependencies.
Documentation
- Detailed usage instructions, including examples for translating JSON and configuring cache settings.
- Unit tests for translation and cache handling.
Known Issues
- Only
File-based caching is supported in this release; additional cache types may be added in future releases.