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

refactor: switch langchain imports to core #805

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

jan-kubica
Copy link
Contributor

@jan-kubica jan-kubica commented Jul 17, 2024

@CLAassistant
Copy link

CLAassistant commented Jul 17, 2024

CLA assistant check
All committers have signed the CLA.

@jan-kubica jan-kubica force-pushed the feat/fix-langchain-import branch 3 times, most recently from ebd440d to 4bbad21 Compare July 18, 2024 04:48
@jan-kubica jan-kubica marked this pull request as ready for review July 18, 2024 04:54
Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Disclaimer: Experimental PR review

PR Summary

  • Updated langchain imports to use langchain_core
  • Switched langchain dependency to langchain-core in pyproject.toml
  • Modified import statements in test files to use updated packages
  • Updated error message for missing langchain installation
  • Changed Bedrock model import to use langchain_aws

6 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings

@jan-kubica jan-kubica force-pushed the feat/fix-langchain-import branch 2 times, most recently from 229f45b to e17e5ab Compare July 20, 2024 11:35
@jan-kubica jan-kubica changed the title fix: switch langchain imports to core refactor: switch langchain imports to core Jul 20, 2024
@jan-kubica jan-kubica force-pushed the feat/fix-langchain-import branch from e17e5ab to 14440b4 Compare July 23, 2024 14:10
@jan-kubica jan-kubica force-pushed the feat/fix-langchain-import branch from 14440b4 to d754d09 Compare August 30, 2024 10:18
@jan-kubica
Copy link
Contributor Author

@maxdeichmann could you please review? thank you

@@ -13,7 +13,7 @@ pydantic = ">=1.10.7, <3.0"
backoff = ">=1.10.0"
openai = { version = ">=0.27.8", optional = true }
wrapt = "^1.14"
langchain = { version = ">=0.0.309", optional = true }
langchain-core = { version = ">=0.2.0", optional = true }
Copy link
Member

Choose a reason for hiding this comment

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

Thanks a lot for the contribution!
Do you know how backwards compatible this is? We might have users who explicitly installed langchain version 0.0.310. I assume that the upgrade would not work for them, correct?

Copy link
Member

Choose a reason for hiding this comment

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

If yes, is there a way to make this backwards compatible?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

  • Users should install langfuse with the langchain extra (and this will ensure they have the langchain-core package installed in their env). If they also have langchain package v0.0.310 installed explicitly or for some other reason, it's fine, these are not clashing.

  • However, if users do not install langfuse with the langchain extra and do not have langchain-core in the env for some other reason, the upgrade will not work for them. I would say that is expected and correct though (if you don't specify you want to use langfuse with langchain, then langfuse<>langchain might not be compatible).

Choose a reason for hiding this comment

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

bump on this? it's a minor inconvenience, but I'd love to see it merged

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

Successfully merging this pull request may close these issues.

refactor: import langchain-core instead of langchain in Langchain Python integration
4 participants