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

Upgrade langchain version to >0.0.239 #285

Closed
michaelchia opened this issue Jul 21, 2023 · 4 comments · Fixed by #375
Closed

Upgrade langchain version to >0.0.239 #285

michaelchia opened this issue Jul 21, 2023 · 4 comments · Fixed by #375
Assignees
Labels
enhancement New feature or request @jupyter-ai/core
Milestone

Comments

@michaelchia
Copy link
Collaborator

Problem

I want to be able to add ChatVertexAI as a provider but it has been broken in langchain till fixed in langchain v0.0.239.
I have to do some hacky monkey patching to langchain in v0.0.220 to get it to work.

I would prefer for jupyter-ai to support langchain>=0.0.239 so I can productionalise it without ugly hacks that may cause issues.

Proposed Solution

Currently the only part I found incompatible with langchain v0.0.239 is in LearnChatHandler. In v0.0.239, langchain.schema.BaseRetriever (which LearnChatHandler inherits) was changed to be a pydantic.BaseModel. Would need a bit of refactoring to make it compatible.

Additional context

I am using jupyter-ai in a corporate setting where I add custom providers, one of which is ChatVertexAI, by adding to the "jupyter_ai.model_providers" entrypoint.

@michaelchia michaelchia added the enhancement New feature or request label Jul 21, 2023
@JasonWeill
Copy link
Collaborator

Per #264 (same reporter), ChatVertexAI also requires the ChatPromptTemplate to be customizable.

@michaelchia
Copy link
Collaborator Author

For that at least as a temporary fix I am able to just override the _generate method in the Provider to remove that empty AIMessage before passing it to the parent class. So in terms of prioritisation, having the langchain version is much more of an issue to me.

@michaelchia
Copy link
Collaborator Author

newer versions of the anthropic sdk (>=0.3) require later version of langchain as well.

@JasonWeill
Copy link
Collaborator

As of Langchain 0.0.267, Pydantic 2 is now supported; see langchain-ai/langchain#6841. This provides another incentive to upgrade.

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

Successfully merging a pull request may close this issue.

3 participants