Skip to content

Gemini #100

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 8 commits into
base: main
Choose a base branch
from
Draft

Gemini #100

wants to merge 8 commits into from

Conversation

jtpio
Copy link
Member

@jtpio jtpio commented Jun 17, 2025

Was curious if it would be quick and easy to add Gemini to the list of default providers.

Fixes #99

jupyterlite-ai-gemini.mp4

@jtpio jtpio added the enhancement New feature or request label Jun 17, 2025
"@langchain/anthropic": "^0.3.22",
"@langchain/community": "^0.3.46",
"@langchain/core": "^0.3.58",
"@langchain/google-genai": "^0.2.12",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The latest version of @langchain/google-genai seems to depend on newer releases of @langchain/core, so bumping the other langchain dependencies here.

tsconfig.json Outdated
@@ -19,6 +19,7 @@
"resolveJsonModule": true,
"outDir": "lib",
"rootDir": "src",
"skipLibCheck": true,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to investigate the following TypeScript build issue:

node_modules/zod/v3/index.d.ts:1:15 - error TS2846: A declaration file cannot be imported without 'import type'. Did you mean to import an implementation file '../dist/types/v3/index.js' instead?

1 export * from "../dist/types/v3/index.d.ts";
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

node_modules/zod/v4/core/index.d.ts:1:15 - error TS2846: A declaration file cannot be imported without 'import type'. Did you mean to import an implementation file '../../dist/types/v4/core/index.js' instead?

1 export * from "../../dist/types/v4/core/index.d.ts";
                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Copy link
Collaborator

@brichet brichet Jun 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be fixed colinhacks/zod#4545
Working fine with resolutions pining it to "^3.25.56".

  "resolutions": {
    "zod": "^3.25.56"
  },

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh cool, thanks!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually my fix was useless, and this dependency issue is already fixed by langchain-ai/langchainjs#8380, not yet released AFAIK.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the latest release may have these changes now: https://github.com/langchain-ai/langchainjs/releases/tag/langchain%3D%3D0.3.29

@jtpio
Copy link
Member Author

jtpio commented Jun 18, 2025

Looks like there is now an issue when running the settings:build script, which may be related to the other @langchain package updates.

@brichet
Copy link
Collaborator

brichet commented Jun 20, 2025

Looks like there is now an issue when running the settings:build script, which may be related to the other @langchain package updates.

We should probably drop the settings generator, or at least remove the test.

I opened #104

@brichet
Copy link
Collaborator

brichet commented Jun 27, 2025

The failing tests seem to be related to the upgrade of zod dependency, after this (huge) PR colinhacks/zod#4074, that has been included in 3.25.X.
It adds the use of ThisType which is not understood by ts-json-schema-generator.

I don't know how to fix it, but we have the same issue in #110

@jtpio
Copy link
Member Author

jtpio commented Jun 27, 2025

CI now passes after #113.

Did a bit of testing locally. The chat works fine. Completions often give a 429 with a lot of requests being made to the Gemini API. So not sure yet if it's because of the API key being used, an issue with the langchain wrapper, or a missing option when instantiating the completer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Gemini models
2 participants