解決方法
chainに with_retry
で Exceptionタイプを指定すればOK
from langchain_core.exceptions import OutputParserException
chain_with_retry = chain.with_retry(
retry_if_exception_type=(OutputParserException,),
wait_exponential_jitter=False, # Not add jitter to the exponential backoff
stop_after_attempt=2, # Try twice
)
Ref