-
Notifications
You must be signed in to change notification settings - Fork 16.1k
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
Conversation
eyurtsev
commented
Apr 22, 2024
- Move storage interface to core
- Move in memory and file system implementation to core
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
libs/core/langchain_core/stores.py
Outdated
@@ -123,3 +129,292 @@ async def ayield_keys( | |||
|
|||
|
|||
ByteStore = BaseStore[str, bytes] | |||
|
|||
|
|||
class LocalFileStore(ByteStore): |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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]): |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
|
||
.. code-block:: python | ||
|
||
from langchain.storage import InMemoryStore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
core