def generate_with_retry(self, **kwargs: Any) -> Any:
        """Use tenacity to retry the completion call."""
        retry_decorator = self._create_retry_decorator()

        @retry_decorator
        def _generate_with_retry(**kwargs: Any) -> Any:
            return self.client.create(**kwargs)

        return _generate_with_retry(**kwargs)
Use tenacity to retry the completion call.
autochain/models/base.py