These methods will work on any Runnable, including Runnable chains constructed
    by composing other Runnables. See the individual methods for details.
    For example,
    .. code-block:: python
        from langchain_core.runnables import RunnableLambda
        import random
        def add_one(x: int) -> int:
            return x + 1
        def buggy_double(y: int) -> int:
            '''Buggy code that will fail 70% of the time'''
            if random.random() > 0.3:
                print('This code failed, and will probably be retried!')
                raise ValueError('Triggered buggy code')
            return y * 2
        sequence = (
            RunnableLambda(add_one) |
            RunnableLambda(buggy_double).with_retry( # Retry on failure
                stop_after_attempt=10,
                wait_exponential_jitter=False
            )
        )
        print(sequence.input_schema.schema()) # Show inferred input schema
        print(sequence.output_schema.schema()) # Show inferred output schema
        print(sequence.invoke(2)) # invoke the sequence (note the retry above!!)
    Debugging and tracing
    =====================
    As the chains get longer, it can be useful to be able to see intermediate results
    to debug and trace the chain.
    You can set the global debug flag to True to enable debug output for all chains:
        .. code-block:: python
            from langchain_core.globals import set_debug
            set_debug(True)
    Alternatively, you can pass existing or custom callbacks to any given chain:
        .. code-block:: python
            from langchain_core.tracers import ConsoleCallbackHandler
            chain.invoke(
                ...,
                config={'callbacks': [ConsoleCallbackHandler()]}
            )