Home / Function/ test_clear_cache() — langchain Function Reference

test_clear_cache() — langchain Function Reference

Architecture documentation for the test_clear_cache() function in cache.py from the langchain codebase.

Function python LangChainCore Runnables calls 4 called by 1

Entity Profile

Dependency Diagram

graph TD
  2ab1a718_2e12_2b3a_b579_e79b76d523f6["test_clear_cache()"]
  8acef6e4_8359_35f5_d0d6_b7f54d292c1b["SyncCacheTestSuite"]
  2ab1a718_2e12_2b3a_b579_e79b76d523f6 -->|defined in| 8acef6e4_8359_35f5_d0d6_b7f54d292c1b
  63f0c800_ef9f_60ea_dc89_457bb7c38bf8["test_clear_cache()"]
  63f0c800_ef9f_60ea_dc89_457bb7c38bf8 -->|calls| 2ab1a718_2e12_2b3a_b579_e79b76d523f6
  adb30ac4_8376_beb9_24d4_c2f227ed75dd["get_sample_prompt()"]
  2ab1a718_2e12_2b3a_b579_e79b76d523f6 -->|calls| adb30ac4_8376_beb9_24d4_c2f227ed75dd
  c1dccca1_eaf9_4fcd_2941_6478d8defcc1["get_sample_llm_string()"]
  2ab1a718_2e12_2b3a_b579_e79b76d523f6 -->|calls| c1dccca1_eaf9_4fcd_2941_6478d8defcc1
  0bbd23c5_ef85_712b_c05e_4daecca423da["get_sample_generation()"]
  2ab1a718_2e12_2b3a_b579_e79b76d523f6 -->|calls| 0bbd23c5_ef85_712b_c05e_4daecca423da
  63f0c800_ef9f_60ea_dc89_457bb7c38bf8["test_clear_cache()"]
  2ab1a718_2e12_2b3a_b579_e79b76d523f6 -->|calls| 63f0c800_ef9f_60ea_dc89_457bb7c38bf8
  style 2ab1a718_2e12_2b3a_b579_e79b76d523f6 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

libs/standard-tests/langchain_tests/integration_tests/cache.py lines 76–83

    def test_clear_cache(self, cache: BaseCache) -> None:
        """Test clearing the cache."""
        prompt = self.get_sample_prompt()
        llm_string = self.get_sample_llm_string()
        generation = self.get_sample_generation()
        cache.update(prompt, llm_string, [generation])
        cache.clear()
        assert cache.lookup(prompt, llm_string) is None

Domain

Subdomains

Called By

Frequently Asked Questions

What does test_clear_cache() do?
test_clear_cache() is a function in the langchain codebase, defined in libs/standard-tests/langchain_tests/integration_tests/cache.py.
Where is test_clear_cache() defined?
test_clear_cache() is defined in libs/standard-tests/langchain_tests/integration_tests/cache.py at line 76.
What does test_clear_cache() call?
test_clear_cache() calls 4 function(s): get_sample_generation, get_sample_llm_string, get_sample_prompt, test_clear_cache.
What calls test_clear_cache()?
test_clear_cache() is called by 1 function(s): test_clear_cache.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free