Skip to content

Conversation

@VrianCao
Copy link
Owner

This commit introduces a series of significant improvements to the translation functionality:

  1. Enhanced Custom API Compatibility:

    • You can now define requestBodyTemplate and responseTextPath for custom APIs, allowing flexible integration with various OpenAI-like services.
    • The backend dynamically constructs requests and parses responses based on these user-defined templates.
  2. Implemented Streaming Output:

    • Streaming is now supported for OpenAI and compatible custom APIs (if configured with supportsStreaming: true).
    • The backend uses Server-Sent Events (SSE) to stream translation chunks.
    • The frontend incrementally displays translated text as it arrives, improving perceived performance.
  3. Configuration for Default Services:

    • You can now configure API keys, models, and other parameters (e.g., Project ID for Google) for preset services (OpenAI, Google, DeepL, etc.) directly in the UI.
    • UI-configured settings take precedence over environment variables.
    • A consistent UI is provided for managing both preset and custom service configurations.
  4. Code Review and General Improvements:

    • Error Handling: Significantly improved across the application. More specific error messages are provided, and localStorage operations are more robust. Comprehensive toast notifications guide you.
    • Code Quality: Refactored key sections for clarity and maintainability. Introduced helper functions like getEffectiveConfigValue to centralize logic. Enhanced TypeScript typings.
    • UI/UX Polish: Added visual cues (e.g., icons for configured services), improved tooltips, and ensured consistent feedback for your actions.
    • Dependency Audit: Performed an audit and applied fixes for several vulnerabilities. Noted a remaining critical vulnerability in next for future attention.

Overall, these changes address the core issues of API compatibility, streaming, configuration, and general maintainability, making the application more powerful and easier to use.

This commit introduces a series of significant improvements to the translation functionality:

1.  **Enhanced Custom API Compatibility**:
    *   You can now define `requestBodyTemplate` and `responseTextPath` for custom APIs, allowing flexible integration with various OpenAI-like services.
    *   The backend dynamically constructs requests and parses responses based on these user-defined templates.

2.  **Implemented Streaming Output**:
    *   Streaming is now supported for OpenAI and compatible custom APIs (if configured with `supportsStreaming: true`).
    *   The backend uses Server-Sent Events (SSE) to stream translation chunks.
    *   The frontend incrementally displays translated text as it arrives, improving perceived performance.

3.  **Configuration for Default Services**:
    *   You can now configure API keys, models, and other parameters (e.g., Project ID for Google) for preset services (OpenAI, Google, DeepL, etc.) directly in the UI.
    *   UI-configured settings take precedence over environment variables.
    *   A consistent UI is provided for managing both preset and custom service configurations.

4.  **Code Review and General Improvements**:
    *   **Error Handling**: Significantly improved across the application. More specific error messages are provided, and `localStorage` operations are more robust. Comprehensive toast notifications guide you.
    *   **Code Quality**: Refactored key sections for clarity and maintainability. Introduced helper functions like `getEffectiveConfigValue` to centralize logic. Enhanced TypeScript typings.
    *   **UI/UX Polish**: Added visual cues (e.g., icons for configured services), improved tooltips, and ensured consistent feedback for your actions.
    *   **Dependency Audit**: Performed an audit and applied fixes for several vulnerabilities. Noted a remaining critical vulnerability in `next` for future attention.

Overall, these changes address the core issues of API compatibility, streaming, configuration, and general maintainability, making the application more powerful and easier to use.
@vercel
Copy link

vercel bot commented May 21, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
simplelmt ❌ Failed (Inspect) May 21, 2025 10:41pm

@netlify
Copy link

netlify bot commented May 21, 2025

Deploy Preview for simplelmt failed.

Name Link
🔨 Latest commit 25b4d57
🔍 Latest deploy log https://app.netlify.com/projects/simplelmt/deploys/682e569a2b672500086beeb0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants