Skip to main content
Glama

MemOS-MCP

by qinshu1109
Apache 2.0
3
  • Linux
  • Apple
test_item.py1.63 kB
import uuid from transformers import DynamicCache from memos.memories.activation.item import ActivationMemoryItem, KVCacheItem class TestActivationMemoryItem: def test_basic_init_and_defaults(self): # Test initialization and default values item = ActivationMemoryItem(memory="test-activation", metadata={"foo": "bar"}) assert item.id is not None assert item.memory == "test-activation" assert isinstance(item.metadata, dict) def test_id_is_uuid(self): # Test that id is a valid UUID item = ActivationMemoryItem(memory="abc") uuid.UUID(item.id) # Should not raise def test_metadata_default(self): # Test that metadata defaults to an empty dict item = ActivationMemoryItem(memory="abc") assert item.metadata == {} class TestKVCacheItem: def test_kvcacheitem_init_and_types(self): # Test initialization and types for KVCacheItem cache = DynamicCache() item = KVCacheItem(memory=cache, metadata={"layer": 1}) assert isinstance(item.memory, DynamicCache) assert item.metadata["layer"] == 1 uuid.UUID(item.id) def test_metadata_default(self): # Test that metadata defaults to an empty dict for KVCacheItem item = KVCacheItem() assert isinstance(item.memory, DynamicCache) assert item.metadata == {} def test_arbitrary_types_allowed(self): # Test that arbitrary types (DynamicCache) are allowed as memory cache = DynamicCache() item = KVCacheItem(memory=cache) assert isinstance(item.memory, DynamicCache)

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/qinshu1109/memos-MCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server