2828import pytest
2929
3030from memory .agent_memory import MemoryAgent
31- from memory .config import AutoencoderConfig , MemoryConfig
31+ from memory .config import MemoryConfig
3232
3333
3434@pytest .fixture
@@ -98,24 +98,25 @@ def memory_agent(
9898 agent_id = "test-agent"
9999 config = MemoryConfig ()
100100 config .autoencoder_config .use_neural_embeddings = True
101- config .text_model_name = "test-model"
101+ config .text_model_name = (
102+ "sentence-transformers/all-MiniLM-L6-v2" # Use a real model
103+ )
102104 config .ltm_config .db_path = "test_memory.db" # Set a valid db path
103105
104- # Mock store classes before instantiating the agent
105- with mock .patch ("memory.agent_memory.RedisSTMStore" ) as mock_stm_class , mock .patch (
106+ with mock .patch ("memory.agent_memory.RedisSTMStore" ) as mock_stm , mock .patch (
106107 "memory.agent_memory.RedisIMStore"
107- ) as mock_im_class , mock .patch (
108+ ) as mock_im , mock .patch (
108109 "memory.agent_memory.SQLiteLTMStore"
109- ) as mock_ltm_class , mock .patch (
110+ ) as mock_ltm , mock .patch (
110111 "memory.agent_memory.CompressionEngine"
111- ), mock .patch (
112- "memory.embeddings.text_embeddings .TextEmbeddingEngine"
113- ):
112+ ) as mock_ce , mock .patch (
113+ "memory.agent_memory .TextEmbeddingEngine"
114+ ) as mock_ae :
114115
115116 # Configure the mock classes to return our mock instances
116- mock_stm_class .return_value = mock_stm_store
117- mock_im_class .return_value = mock_im_store
118- mock_ltm_class .return_value = mock_ltm_store
117+ mock_stm .return_value = mock_stm_store
118+ mock_im .return_value = mock_im_store
119+ mock_ltm .return_value = mock_ltm_store
119120
120121 agent = MemoryAgent (agent_id , config )
121122
@@ -147,7 +148,7 @@ def test_init(self):
147148 ) as mock_ltm , mock .patch (
148149 "memory.agent_memory.CompressionEngine"
149150 ) as mock_ce , mock .patch (
150- "memory.embeddings.text_embeddings .TextEmbeddingEngine"
151+ "memory.agent_memory .TextEmbeddingEngine"
151152 ) as mock_ae :
152153
153154 agent = MemoryAgent (agent_id , config )
@@ -174,7 +175,7 @@ def test_init_without_neural_embeddings(self):
174175 ), mock .patch ("memory.agent_memory.SQLiteLTMStore" ), mock .patch (
175176 "memory.agent_memory.CompressionEngine"
176177 ), mock .patch (
177- "memory.embeddings.text_embeddings .TextEmbeddingEngine"
178+ "memory.agent_memory .TextEmbeddingEngine"
178179 ) as mock_te :
179180
180181 agent = MemoryAgent (agent_id , config )
0 commit comments