create_base_retry_decorator#
- langchain_core.language_models.llms.create_base_retry_decorator(error_types: list[type[BaseException]], max_retries: int = 1, run_manager: AsyncCallbackManagerForLLMRun | CallbackManagerForLLMRun | None = None) Callable[[Any], Any] [source]#
- Create a retry decorator for a given LLM and provided
a list of error types.
- Parameters:
error_types (list[type[BaseException]]) – List of error types to retry on.
max_retries (int) – Number of retries. Default is 1.
run_manager (AsyncCallbackManagerForLLMRun | CallbackManagerForLLMRun | None) – Callback manager for the run. Default is None.
- Returns:
A retry decorator.
- Raises:
ValueError – If the cache is not set and cache is True.
- Return type:
Callable[[Any], Any]