MCPcopy Create free account
hub / github.com/OpenBMB/ChatDev / _make_memory_item

Function _make_memory_item

tests/test_memory_embedding_consistency.py:25–32  ·  view source on GitHub ↗

Create a MemoryItem with an embedding of the specified dimension.

(item_id: str, dim: int)

Source from the content-addressed store, hash-verified

23
24
25def _make_memory_item(item_id: str, dim: int):
26 """Create a MemoryItem with an embedding of the specified dimension."""
27 return MemoryItem(
28 id=item_id,
29 content_summary=f"content for {item_id}",
30 metadata={},
31 embedding=[float(i) for i in range(dim)],
32 )
33
34
35class TestSimpleMemoryRetrieveMixedDimensions:

Calls 1

MemoryItemClass · 0.90

Tested by

no test coverage detected