Framework for orchestrating role-playing, autonomous AI agents. By fostering collaborative intelligence, CrewAI empowers agents to work together seamlessly, tackling complex tasks.
fix: deflake MemoryRecord embedding serialization test
Greyson LaLonde7e1672447b44
diff --git a/lib/crewai/tests/memory/test_unified_memory.py b/lib/crewai/tests/memory/test_unified_memory.pyindex 05bb977ac..be52e6db5 100644--- a/lib/crewai/tests/memory/test_unified_memory.py+++ b/lib/crewai/tests/memory/test_unified_memory.py@@ -51,14 +51,13 @@ def test_memory_record_embedding_excluded_from_serialization() -> None:dumped = r.model_dump()assert "embedding" not in dumpedassert dumped["content"] == "hello"-- # model_dump_json excludes embeddingjson_str = r.model_dump_json()- assert "0.1" not in json_strassert "embedding" not in json_str+ rehydrated = MemoryRecord.model_validate_json(json_str)+ assert rehydrated.embedding is None# repr excludes embedding- assert "0.1" not in repr(r)+ assert "embedding=" not in repr(r)# Direct attribute access still works for storage layerassert r.embedding is not None