update_cache#
- langchain_core.language_models.llms.update_cache(cache: BaseCache | bool | None, existing_prompts: Dict[int, List], llm_string: str, missing_prompt_idxs: List[int], new_results: LLMResult, prompts: List[str]) dict | None [source]#
Update the cache and get the LLM output.
- Parameters:
cache (BaseCache | bool | None) – Cache object.
existing_prompts (Dict[int, List]) – Dictionary of existing prompts.
llm_string (str) – LLM string.
missing_prompt_idxs (List[int]) – List of missing prompt indexes.
new_results (LLMResult) – LLMResult object.
prompts (List[str]) – List of prompts.
- Returns:
LLM output.
- Raises:
ValueError – If the cache is not set and cache is True.
- Return type:
dict | None