Skip to content

1.0.0

Choose a tag to compare

@mantoufan mantoufan released this 03 Oct 16:39
· 20 commits to main since this release

Release Notes - Version 1.0.0

YZhanJSONTranslater

Release Date: October 4, 2024


New Features

  1. 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.
  2. Customizable API Client Configuration:

    • Ability to configure OpenAI client settings, including API key, organization ID, and API URL.
  3. 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 maxAge field to control how long cache is valid.
  4. Environment Variables Support:

    • Configure OpenAI credentials through environment variables (OPENAI_APIKEY, OPENAI_APIURL, OPENAI_ORGANIZATION).

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 using phpunit.
    • 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.