Skip to content
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

Update to a newer @langchain/community to fix ChromeAI integration #43

Merged
merged 3 commits into from
Feb 18, 2025

Conversation

jtpio
Copy link
Member

@jtpio jtpio commented Feb 15, 2025

ChromeAI was recently giving some really weird results, pretty much gibberish.

This was odd because using the API in the dev tools directly seems to be working fine:

image

Digging a bit more into it, it looks like an issue in the @langchain/community package.

I opened a PR upstream, which seems to be fixing the issue with the latest Chrome 133 release (as of today): langchain-ai/langchainjs#7700

Before

image

After

image

With streaming:

jupyterlite-ai-chromeai-streaming.mp4

@jtpio jtpio changed the title Fix ChromeAI integration Fix ChromeAI integration, patch @langchain/community Feb 15, 2025
@jtpio jtpio added the bug Something isn't working label Feb 15, 2025
@@ -0,0 +1,13 @@
diff --git a/node_modules/@langchain/community/dist/experimental/llms/chrome_ai.js b/node_modules/@langchain/community/dist/experimental/llms/chrome_ai.js
Copy link
Member Author

@jtpio jtpio Feb 15, 2025

Choose a reason for hiding this comment

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

This file (and the patch-package / postinstall-postinstall dependencies) can be removed later after updating to a newer version of @langchain/community what would include langchain-ai/langchainjs#7700.

@jtpio jtpio marked this pull request as ready for review February 15, 2025 13:01
@brichet
Copy link
Collaborator

brichet commented Feb 17, 2025

Thanks @jtpio.
I was wondering if it was a recent change in chrome-ai or in @langchainjs but just realize that this is following the default use of streaming in this repo, after #39

@jtpio
Copy link
Member Author

jtpio commented Feb 17, 2025

I was wondering if it was a recent change in chrome-ai or in @langchainjs but just realize that this is following the default use of streaming in this repo, after #39

Right, but I also tried locally with the wheel built by check-release in #27 (before supporting streaming), and it was the same issue.

@jtpio jtpio changed the title Fix ChromeAI integration, patch @langchain/community Update to a newer @langchain/community to fix ChromeAI integration Feb 18, 2025
@jtpio
Copy link
Member Author

jtpio commented Feb 18, 2025

langchain-ai/langchainjs#7700 has been merged and released, so we can remove the patch here.

Copy link
Collaborator

@brichet brichet left a comment

Choose a reason for hiding this comment

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

Looks great, thanks @jtpio .

BTW, I didn't know the patch workaround, nice to temporary fix an upstream issue 👍

@jtpio
Copy link
Member Author

jtpio commented Feb 18, 2025

Thanks for the review!

BTW, I didn't know the patch workaround, nice to temporary fix an upstream issue 👍

Yeah it is indeed convenient and somewhat "clean" :)

@jtpio jtpio merged commit 6f14cfb into jupyterlite:main Feb 18, 2025
7 checks passed
@jtpio jtpio deleted the fix-chromeai branch February 18, 2025 09:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants