because it is tidally locked to Earth.    CPU times: user 4.09 ms, sys: 0 ns, total: 4.09 ms    Wall time: 119 msSemantic cache‚ÄãThis cache will do a semantic similarity search and return a hit if it finds a cached entry that is similar enough, For this, you need to provide an Embeddings instance of your choice.from langchain.embeddings import OpenAIEmbeddingsembedding=OpenAIEmbeddings()from langchain.cache import CassandraSemanticCacheset_llm_cache(    CassandraSemanticCache(        session=session, keyspace=keyspace, embedding=embedding, table_name="cass_sem_cache"    ))print(llm("Why is the Moon always showing the same side?"))            The Moon always shows the same side because it is tidally locked with Earth. This means that the same side of the Moon always faces Earth.    CPU times: user 21.3 ms, sys: 177 ¬µs, total: 21.4 ms    Wall time: 3.09 sprint(llm("How come we always see one face of the moon?"))            The Moon always shows the same side because it is tidally locked with Earth. This means that the same side of the Moon always faces Earth.    CPU times: user 10.9 ms, sys: 17 ¬µs, total: 10.9 ms    Wall time: 461 msOptional Caching‚ÄãYou can also turn off caching for specific LLMs should you choose. In the example below, even though global caching is enabled, we turn it off for a specific LLMllm = OpenAI(model_name="text-davinci-002", n=2, best_of=2, cache=False)llm("Tell me a joke")    CPU times: user 5.8 ms, sys: 2.71 ms, total: 8.51 ms    Wall time: 745 ms    '\n\nWhy did the chicken cross the road?\n\nTo get to the other side!'llm("Tell me a joke")    CPU times: user 4.91 ms, sys: 2.64 ms, total: 7.55 ms    Wall time: 623 ms    '\n\nTwo guys stole a calendar. They got six months each.'Optional Caching in Chains‚ÄãYou can also turn off caching for particular nodes in chains. Note that because of certain interfaces, its often easier to construct the chain first, and then edit the LLM afterwards.As an example, we will load a summarizer
This notebook covers how to cache results of individual LLM calls using different caches.
This notebook covers how to cache results of individual LLM calls using different caches. ->: because it is tidally locked to Earth.    CPU times: user 4.09 ms, sys: 0 ns, total: 4.09 ms    Wall time: 119 msSemantic cache‚ÄãThis cache will do a semantic similarity search and return a hit if it finds a cached entry that is similar enough, For this, you need to provide an Embeddings instance of your choice.from langchain.embeddings import OpenAIEmbeddingsembedding=OpenAIEmbeddings()from langchain.cache import CassandraSemanticCacheset_llm_cache(    CassandraSemanticCache(        session=session, keyspace=keyspace, embedding=embedding, table_name="cass_sem_cache"    ))print(llm("Why is the Moon always showing the same side?"))            The Moon always shows the same side because it is tidally locked with Earth. This means that the same side of the Moon always faces Earth.    CPU times: user 21.3 ms, sys: 177 ¬µs, total: 21.4 ms    Wall time: 3.09 sprint(llm("How come we always see one face of the moon?"))            The Moon always shows the same side because it is tidally locked with Earth. This means that the same side of the Moon always faces Earth.    CPU times: user 10.9 ms, sys: 17 ¬µs, total: 10.9 ms    Wall time: 461 msOptional Caching‚ÄãYou can also turn off caching for specific LLMs should you choose. In the example below, even though global caching is enabled, we turn it off for a specific LLMllm = OpenAI(model_name="text-davinci-002", n=2, best_of=2, cache=False)llm("Tell me a joke")    CPU times: user 5.8 ms, sys: 2.71 ms, total: 8.51 ms    Wall time: 745 ms    '\n\nWhy did the chicken cross the road?\n\nTo get to the other side!'llm("Tell me a joke")    CPU times: user 4.91 ms, sys: 2.64 ms, total: 7.55 ms    Wall time: 623 ms    '\n\nTwo guys stole a calendar. They got six months each.'Optional Caching in Chains‚ÄãYou can also turn off caching for particular nodes in chains. Note that because of certain interfaces, its often easier to construct the chain first, and then edit the LLM afterwards.As an example, we will load a summarizer