fix(deps): update dependencies to use google/genai#1021
Merged
lacolaco merged 1 commit intoangular:mainfrom Apr 10, 2025
Merged
fix(deps): update dependencies to use google/genai#1021lacolaco merged 1 commit intoangular:mainfrom
lacolaco merged 1 commit intoangular:mainfrom
Conversation
| await setTimeout(3000); | ||
| }); | ||
|
|
||
| if (response.text) { |
There was a problem hiding this comment.
The conditional check on response.text may inadvertently treat a valid empty string as a missing response. Consider explicitly checking for undefined or null to distinguish an empty but valid response from an error.
Suggested change
| if (response.text) { | |
| if (response.text !== undefined && response.text !== null) { |
0bd43ba to
c6cf9c5
Compare
c6cf9c5 to
733cc3a
Compare
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 pull request includes significant changes to the
tools/translator/translate.tsfile and a dependency update in thepackage.jsonfile. The primary focus is on updating the Google Generative AI library and refactoring the translation logic to accommodate this update.Dependency update:
package.json: Updated the dependency from@google/generative-aito@google/genaiand changed the version to^0.8.0.Refactoring translation logic:
tools/translator/translate.ts: Replaced imports ofGoogleGenerativeAIandGoogleAIFileManagerwithGoogleGenAI. Updated the class properties and constructor to use the newGoogleGenAIclient.tools/translator/translate.ts: Removed the detailed model configuration and chat session setup from thetranslatemethod. Instead, used theGoogleGenAIclient to generate content directly.tools/translator/translate.ts: Simplified the translation prompt and adjusted the response handling to accommodate the new API. Added a fallback for cases where no response is received.tools/translator/translate.ts: Removed redundant input format instructions from the translation prompt.