print(sequence.output_schema.schema()) # Show inferred output schema
print(sequence.invoke(2)) # invoke the sequence (note the retry above!!)
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:
from langchain_core.globals import set_debug
set_debug(True)
Alternatively, you can pass existing or custom callbacks to any given chain:
from langchain_core.tracers import ConsoleCallbackHandler
chain.invoke(
    ...,
    config={'callbacks': [ConsoleCallbackHandler()]}
)
For a UI (and much more) checkout LangSmith: https://docs.smith.langchain.com/
Attributes
InputType
The type of input this runnable accepts specified as a type annotation.
OutputType
The type of output this runnable produces specified as a type annotation.
config_specs
List configurable fields for this runnable.
input_schema
The type of input this runnable accepts specified as a pydantic model.
output_schema
The type of output this runnable produces specified as a pydantic model.
Methods
__init__()
abatch(inputs[, config, return_exceptions])
Default implementation runs ainvoke in parallel using asyncio.gather.
ainvoke(input[, config])
Default implementation of ainvoke, calls invoke from a thread.
astream(input[, config])
Default implementation of astream, which calls ainvoke.
astream_log()
Stream all output from a runnable, as reported to the callback system.
atransform(input[, config])
Default implementation of atransform, which buffers input and calls astream.
batch(inputs[, config, return_exceptions])
Default implementation runs invoke in parallel using a thread pool executor.
bind(**kwargs)
Bind arguments to a Runnable, returning a new Runnable.