import os
import pathlib
import langchain
import langchain.cache
import langchain.globals

CACHE_BASE = pathlib.Path(f'{os.environ["HOME"]}/.cache/mitaskem/')
CACHE_BASE.mkdir(parents=True, exist_ok=True)
_LLM_CACHE_PATH = CACHE_BASE/'langchain_llm_cache.sqlite'
langchain.globals.set_llm_cache(langchain.cache.SQLiteCache(database_path=_LLM_CACHE_PATH))
langchain.cache.SQLiteCache
[((104, 158), 'pathlib.Path', 'pathlib.Path', (['f"""{os.environ[\'HOME\']}/.cache/mitaskem/"""'], {}), '(f"{os.environ[\'HOME\']}/.cache/mitaskem/")\n', (116, 158), False, 'import pathlib\n'), ((295, 353), 'langchain.cache.SQLiteCache', 'langchain.cache.SQLiteCache', ([], {'database_path': '_LLM_CACHE_PATH'}), '(database_path=_LLM_CACHE_PATH)\n', (322, 353), False, 'import langchain\n')]