Skip to main content

内存字节存储

InMemoryByteStoreByteStore 的非持久化实现,它将所有数据存储在 Python 字典中。

from langchain.storage import InMemoryByteStore
store = InMemoryByteStore()
store.mset([("k1", b"v1"), ("k2", b"v2")])
print(store.mget(["k1", "k2"]))
[b'v1', b'v2']

Was this page helpful?


You can leave detailed feedback on GitHub.