langchain icon indicating copy to clipboard operation
langchain copied to clipboard

Issue: langchainplus-sdk dependency

Open YYYasin19 opened this issue 1 year ago • 1 comments

Issue you'd like to raise.

Currently, the newest version 0.0.194 is not building on conda-forge since langchainplus-sdk is missing. I can't add that to conda-forge, though, since I have neither found source code nor a licence file for that package - other than the PyPI release.

Is langchainplus-sdk a strongly needed dependency or can it be made optional like many others as well? This prevents the newest version from being installable through conda/mama/micromamba etc.

Suggestion:

Remove the dependency on langchainplus-sdk with optional=True.

YYYasin19 avatar Jun 08 '23 21:06 YYYasin19

Thanks for flagging this @YYYasin19 , and thank you for your patience! I'll work on resolving this. We moved some callbacks schemas to a shared package to let people use some of the callbacks outside the langchain repository, but I don't want this to impact anyone's projects.

vowelparrot avatar Jun 16 '23 00:06 vowelparrot

This is still an issue and should be resolved. This project states to be open source on the front page of its Github profile and by that it shouldn't rely non free code blobs as a hard dependency and break projects if not installed:

ModuleNotFoundError: No module named 'langchainplus_sdk'

r7l avatar Jun 22 '23 20:06 r7l

Opened a PR to add to conda https://github.com/conda-forge/staged-recipes/pull/23151

We'll publish the SDK repo. It's used for tracing schemas that are shared with other providers (e.g., WandB) so I'm not going to make it optional right now.

@r7l if it's blocking your work flow, you can feel free to work on adding to conda.

vowelparrot avatar Jun 22 '23 20:06 vowelparrot

Made the MIT-licensed code public https://github.com/langchain-ai/langchainplus-sdk

Timeline for incorporation in conda is now dependent on their review cycles.

vowelparrot avatar Jun 22 '23 20:06 vowelparrot

@vowelparrot I am not using Conda. I am using plain Python and usually i am only installing dependencies as needed. Langchain has way to many dependencies by default but that's not the issue as long as it's possible to move around if you don't need them.

I've had another comment almost finished (deleted it) but you went ahead an published langchainplus-sdk. Thanks allot!

Don't get me wrong. It's totally ok to offer a paid service but it shouldn't be set as a hard dependency in an open source framework and cause even simple lines like these to depend on it:

from langchain.document_loaders import TextLoader
loader = TextLoader('../test.txt')

Dependencies on Langchainplus should be optional. Even if it's opensource now.

r7l avatar Jun 22 '23 20:06 r7l

I agree on the principal. Though the service is free as well and you can run it locally on docker.

I'll chat about whether to make the dep optional but it would involve copying schema code back in here to avoid breaking other integrations so I'm not sure how much it actually adds

vowelparrot avatar Jun 22 '23 21:06 vowelparrot

Out of curiosity, how many of the current required dependencies do you wish you could remove. There's something like ~10 where most are pretty small

vowelparrot avatar Jun 22 '23 21:06 vowelparrot

Actually, i didn't say i want anything to be removed apart from Langchainplus and even that only in terms of being required right away when calling the first function, class or object. Other then that it's ok to be part of Langchain for people who want it.

What i mean with having allot of dependencies is that the project is pretty large with everything included right away. I am working with Django here and there. For example: They didn't include stuff like Redis straight into the main package. It's there but it's a separate project / repo and you can install it when needed. I am aware of dependencies being optional in Langchain but splitting the core project from modules (i think you refer to it as "integrations") does come with the benefit that you don't need to push new versions every other day when working on these modules.

But again: I didn't ask you to restructure the entire project.

r7l avatar Jun 22 '23 22:06 r7l

I really appreciate the thoughtful response! I'll pass along the feedback. It's people like yourself that make me love this community and project

vowelparrot avatar Jun 23 '23 08:06 vowelparrot

Thanks for your patience, everyone. Couple updates on this (good and bad news)

  1. (Bad news) We're updating the package from langchainplus-sdk to langsmith in https://github.com/hwchase17/langchain/pull/7388
  • This will replace the langchainplus-sdk required dep with the differently named langsmith dep
  • The source code is the same: https://github.com/langchain-ai/langchainplus-sdk
  • PR opened to add to conda: https://github.com/conda-forge/staged-recipes/pull/23337/files
  1. (Good news) We're planning to make this dependency optional in the future and have the schemas live directly in langchain. We are also planning to decompose the large langchain repo into core packages to reduce the overhead and dependency list when all you want to do is access certain functionality

vowelparrot avatar Jul 12 '23 23:07 vowelparrot

I am also just removing langchain from my projects since after updating just this line: from langchain.text_splitter import RecursiveCharacterTextSplitter

has thrown multiple projects of mine in disarray and now is throwing a docker compose error - i am not using docker, not wishing to user docker, and was able to run this program yesterday with no errors. this is an extremely frustrating issue, so far langchain has just made easy things hard for me.

val-fatale avatar Aug 02 '23 21:08 val-fatale

Thanks for the feedback, @val-fatale . I'll try to remove the dep entirely.

If you could share a stacktrace either here or to [email protected] , I'll do my best to address that specific issue

hinthornw avatar Aug 02 '23 21:08 hinthornw

Hi, @YYYasin19! I'm Dosu, and I'm helping the LangChain team manage their backlog. I wanted to let you know that we are marking this issue as stale.

From what I understand, the issue was about the newest version of the package not building on conda-forge due to the missing langchainplus-sdk dependency. However, vowelparrot, the maintainer, has resolved this issue by opening a PR to add the langchainplus-sdk dependency to conda and making the code public. They are also considering making the dependency optional in the future and decomposing the large langchain repo into core packages.

Before we close this issue, we wanted to check with you if it is still relevant to the latest version of the LangChain repository. If it is, please let us know by commenting on the issue. Otherwise, feel free to close the issue yourself, or it will be automatically closed in 7 days.

Thank you for your understanding and contribution to the LangChain project!

dosubot[bot] avatar Nov 01 '23 16:11 dosubot[bot]