Download scripts/ops/verify_id.py from Granis87/MnemoCore: direct link, hf CLI and curl.
- Browser
- Download file 956 Bytes
-
https://huggingface.co/Granis87/MnemoCore/resolve/main/scripts/ops/verify_id.py
- Command line
-
hf download hf://Granis87/MnemoCore/scripts/ops/verify_id.py
-
curl -L -o verify_id.py https://huggingface.co/Granis87/MnemoCore/resolve/main/scripts/ops/verify_id.py
956 Bytes
| import asyncio | |
| import uuid | |
| from mnemocore.core.engine import HAIMEngine | |
| from mnemocore.core.config import get_config | |
| async def verify(): | |
| print("Initializing Engine...") | |
| engine = HAIMEngine() | |
| content = "This is a test memory to verify UUID format." | |
| print(f"Storing memory: '{content}'") | |
| node_id = await engine.store(content) | |
| print(f"Generated Node ID: {node_id}") | |
| # Check if it's a valid UUID | |
| try: | |
| val = uuid.UUID(node_id, version=4) | |
| print(f"SUCCESS: {node_id} is a valid UUIDv4") | |
| except ValueError: | |
| print(f"FAILURE: {node_id} is NOT a valid UUIDv4") | |
| return | |
| # Verify retrieval | |
| node = await engine.get_memory(node_id) | |
| if node and node.id == node_id: | |
| print(f"SUCCESS: Retrieved node with ID {node.id}") | |
| else: | |
| print("FAILURE: Could not retrieve node or ID mismatch") | |
| if __name__ == "__main__": | |
| asyncio.run(verify()) | |