mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-10-16 14:57:20 +00:00
migrate memory banks to Resource and new registration
This commit is contained in:
parent
b4416b72fd
commit
c82f13bf9e
16 changed files with 178 additions and 104 deletions
|
@ -43,14 +43,15 @@ def sample_documents():
|
|||
|
||||
|
||||
async def register_memory_bank(banks_impl: MemoryBanks):
|
||||
bank = VectorMemoryBankDef(
|
||||
identifier="test_bank",
|
||||
embedding_model="all-MiniLM-L6-v2",
|
||||
chunk_size_in_tokens=512,
|
||||
overlap_size_in_tokens=64,
|
||||
)
|
||||
|
||||
await banks_impl.register_memory_bank(bank)
|
||||
await banks_impl.register_memory_bank(
|
||||
VectorRegistration(
|
||||
memory_bank_id="test_bank",
|
||||
embedding_model="all-MiniLM-L6-v2",
|
||||
chunk_size_in_tokens=512,
|
||||
overlap_size_in_tokens=64,
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
class TestMemory:
|
||||
|
@ -68,8 +69,8 @@ class TestMemory:
|
|||
# NOTE: this needs you to ensure that you are starting from a clean state
|
||||
# but so far we don't have an unregister API unfortunately, so be careful
|
||||
_, banks_impl = memory_stack
|
||||
bank = VectorMemoryBankDef(
|
||||
identifier="test_bank_no_provider",
|
||||
bank = VectorRegistration(
|
||||
memory_bank_id="test_bank_no_provider",
|
||||
embedding_model="all-MiniLM-L6-v2",
|
||||
chunk_size_in_tokens=512,
|
||||
overlap_size_in_tokens=64,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue