@@ -156,7 +156,6 @@ async def test_async_update_and_lookup_roundtrip(
156156 assert len (hits ) == 1
157157 assert hits [0 ].text == "Redis is an in-memory data store (async)."
158158
159- @pytest .mark .skip ("Waiting on upstream RedisVL release to fix" )
160159 def test_clear_removes_entries (
161160 self , langcache_with_attrs : LangCacheSemanticCache
162161 ) -> None :
@@ -189,118 +188,25 @@ async def test_aclear_removes_entries(
189188 await langcache_with_attrs .aclear ()
190189 assert await langcache_with_attrs .alookup (prompt , llm_string ) is None
191190
192- def test_llm_string_with_comma_roundtrip (
193- self , langcache_with_attrs : LangCacheSemanticCache
194- ) -> None :
195- """llm_string values containing commas should still round-trip.
196-
197- The client encodes commas as a fullwidth comma when sending attributes
198- to LangCache for validation/filtering, but lookup() should continue to
199- work when called with the original llm_string containing commas.
200- """
201191
202- prompt = "Comma llm_string (sync)"
203- llm_string = "openai/gpt-4o,temperature=0.2,max_tokens=128"
204- result = [ Generation ( text = "Response for llm_string with commas (sync)." )]
205-
206- langcache_with_attrs . update ( prompt , llm_string , result )
207- hits = langcache_with_attrs . lookup ( prompt , llm_string )
192+ @ pytest . mark . requires_api_keys
193+ class TestLangCacheSemanticCacheIntegrationWithoutAttributes :
194+ def test_update_errors_when_no_attributes_configured (
195+ self , langcache_no_attrs : LangCacheSemanticCache
196+ ) -> None :
197+ """update() should raise if attributes are not configured on the cache."""
208198
209- assert hits is not None
210- assert len (hits ) == 1
211- assert hits [0 ].text == "Response for llm_string with commas (sync)."
212-
213- @pytest .mark .asyncio
214- async def test_llm_string_with_comma_roundtrip_async (
215- self , langcache_with_attrs : LangCacheSemanticCache
216- ) -> None :
217- """Async variant of the comma llm_string round-trip test."""
199+ prompt = "Attributes not configured (sync)"
200+ llm_string = "langchain-redis/tests:no-attributes:sync"
218201
219- prompt = "Comma llm_string (async)"
220- llm_string = "openai/gpt-4o,temperature=0.3,max_tokens=256"
221- result = [Generation (text = "Response for llm_string with commas (async)." )]
222-
223- await langcache_with_attrs .aupdate (prompt , llm_string , result )
224- hits = await langcache_with_attrs .alookup (prompt , llm_string )
225-
226- assert hits is not None
227- assert len (hits ) == 1
228- assert hits [0 ].text == "Response for llm_string with commas (async)."
229-
230-
231- @pytest .mark .requires_api_keys
232- class TestRedisVLLangCacheDirectWithoutAttributes :
233- """Direct redisvl client behavior without llm_string attribute filters.
234-
235- These tests verify that the underlying LangCache instance used for
236- "with attributes" scenarios can successfully round-trip entries when
237- we do *not* send any attributes in the search request. This helps
238- distinguish adapter-level issues (llm_string attribute handling) from
239- underlying LangCache behavior.
240- """
241-
242- def test_direct_store_and_check_without_attributes (
243- self , rv_langcache_with_attrs : "RedisVLLangCacheSemanticCache"
244- ) -> None :
245- """Store and retrieve using the redisvl client, no attributes filter."""
202+ with pytest .raises (RuntimeError ) as exc :
203+ langcache_no_attrs .update (
204+ prompt ,
205+ llm_string ,
206+ [Generation (text = "This should not be stored." )],
207+ )
246208
247- prompt = "RedisVL direct no-attrs (sync)"
248- response = "Direct response without attributes filter."
249-
250- entry_id = rv_langcache_with_attrs .store (prompt = prompt , response = response )
251- assert entry_id
252-
253- hits = rv_langcache_with_attrs .check (prompt = prompt , num_results = 1 )
254-
255- assert hits
256- assert hits [0 ]["prompt" ] == prompt
257- assert hits [0 ]["response" ] == response
258-
259- def test_direct_store_with_metadata_and_check_without_attributes (
260- self , rv_langcache_with_attrs : "RedisVLLangCacheSemanticCache"
261- ) -> None :
262- """Store with metadata but still retrieve without attributes filter.
263-
264- This ensures that even when we provide metadata (attributes) at
265- write-time, we can still successfully retrieve the entry without
266- sending any attributes filter to LangCache.
267- """
268-
269- prompt = "RedisVL direct metadata no-attrs (sync)"
270- response = "Direct response with metadata but no attributes filter."
271-
272- entry_id = rv_langcache_with_attrs .store (
273- prompt = prompt ,
274- response = response ,
275- metadata = {"llm_string" : "redisvl-direct:no-attrs" },
276- )
277- assert entry_id
278-
279- hits = rv_langcache_with_attrs .check (prompt = prompt , num_results = 1 )
280-
281- assert hits
282- assert hits [0 ]["prompt" ] == prompt
283- assert hits [0 ]["response" ] == response
284-
285-
286- @pytest .mark .requires_api_keys
287- class TestLangCacheSemanticCacheIntegrationWithoutAttributes :
288- def test_update_errors_when_no_attributes_configured (
289- self , langcache_no_attrs : LangCacheSemanticCache
290- ) -> None :
291- """update() should raise if attributes are not configured on the cache."""
292-
293- prompt = "Attributes not configured (sync)"
294- llm_string = "langchain-redis/tests:no-attributes:sync"
295-
296- with pytest .raises (RuntimeError ) as exc :
297- langcache_no_attrs .update (
298- prompt ,
299- llm_string ,
300- [Generation (text = "This should not be stored." )],
301- )
302-
303- assert "attributes are not configured for this cache" in str (exc .value ).lower ()
209+ assert "attributes are not configured for this cache" in str (exc .value ).lower ()
304210
305211 def test_lookup_errors_when_no_attributes_configured (
306212 self , langcache_no_attrs : LangCacheSemanticCache
0 commit comments