feat: Comprehensive translation service enhancements and fixes#4
Open
feat: Comprehensive translation service enhancements and fixes#4
Conversation
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.
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
❌ Deploy Preview for simplelmt failed.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit introduces a series of significant improvements to the translation functionality:
Enhanced Custom API Compatibility:
requestBodyTemplateandresponseTextPathfor custom APIs, allowing flexible integration with various OpenAI-like services.Implemented Streaming Output:
supportsStreaming: true).Configuration for Default Services:
Code Review and General Improvements:
localStorageoperations are more robust. Comprehensive toast notifications guide you.getEffectiveConfigValueto centralize logic. Enhanced TypeScript typings.nextfor 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.