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

core[minor],langchain[patch],community[patch]: Move storage interfaces to core #20750

Merged
merged 9 commits into from
Apr 30, 2024

Conversation

eyurtsev
Copy link
Collaborator

  • Move storage interface to core
  • Move in memory and file system implementation to core

Copy link

vercel bot commented Apr 22, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Ignored Deployment
Name Status Preview Comments Updated (UTC)
langchain ⬜️ Ignored (Inspect) Visit Preview Apr 24, 2024 5:55pm

@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. 🤖:refactor A large refactor of a feature(s) or restructuring of many files labels Apr 22, 2024
@@ -123,3 +129,292 @@ async def ayield_keys(


ByteStore = BaseStore[str, bytes]


class LocalFileStore(ByteStore):
Copy link
Member

Choose a reason for hiding this comment

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

feel pretty strongly this shouldn't be in core. Maybe a langchain-fs package. Or just in community.

Feels too easy of a target for vulnerabilities.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

langchain-fs works

yield str(relative_path)


class InMemoryBaseStore(BaseStore[str, V], Generic[V]):
Copy link
Member

Choose a reason for hiding this comment

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

this is fine in core too. But if we're doing in memory implementations of everything, could also put all these in a langchain-inmemory implementation package

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

IMO core might make more sense since the in memory abstraction is useful for testing of core itself

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. and removed size:XL This PR changes 500-999 lines, ignoring generated files. labels Apr 24, 2024

.. code-block:: python

from langchain.storage import InMemoryStore
Copy link
Collaborator

Choose a reason for hiding this comment

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

core

@dosubot dosubot bot added the lgtm PR looks good. Use to confirm that a PR is ready for merging. label Apr 24, 2024
@eyurtsev eyurtsev merged commit 3c064a7 into master Apr 30, 2024
96 checks passed
@eyurtsev eyurtsev deleted the eugene/storage branch April 30, 2024 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lgtm PR looks good. Use to confirm that a PR is ready for merging. 🤖:refactor A large refactor of a feature(s) or restructuring of many files size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants