🚀 feat: Add Gemini 2.0 Support, Update Packages and Deprecations #4951
+29
−45
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.
Summary
I added support for the Gemini 2.0 model, updated Express to address a security vulnerability, specified the
.env
file in the launch configuration, and fixed deprecated MongoDB functions and options.Added Gemini 2.0 support:
.env.example
to includegemini-2.0-flash-exp
inGOOGLE_MODELS
.'gemini-2.0'
totokenValues
inapi/models/tx.js
.'gemini-2.0'
togoogleModels
inapi/utils/tokens.js
.packages/data-provider/package.json
to0.7.59
.'gemini-2.0'
tovisionModels
inpackages/data-provider/src/config.ts
.Updated Express to version 4.21.2 to address CVE-2024-52798:
api/package.json
to update Express from^4.21.1
to^4.21.2
.path-to-regexp
ReDoS in 0.1.x (CVE-2024-52798, CVE-2024-45296) expressjs/express#6216Specified the
.env
file in the launch configuration:"envFile": "${workspaceFolder}/.env"
in.vscode/launch.json
.Fixed deprecated MongoDB functions and options:
count()
withcountDocuments()
inconfig/user-stats.js
.useNewUrlParser
anduseUnifiedTopology
inapi/lib/db/connectDb.js
.Change Type
Testing
I tested the addition of the Gemini 2.0 model by initiating conversations using the new model and verifying that responses are generated correctly. I ensured that the application runs without warnings or errors due to the updated dependencies and deprecated function replacements. I confirmed that the MongoDB connections work successfully without the deprecated options and that counting functions return correct results. I also verified that the
.env
file is correctly loaded in the launch configuration.Test Configuration:
Checklist