langchain.schema.runnable.base.Runnable¶
class langchain.schema.runnable.base.Runnable[source]¶
A Runnable is a unit of work that can be invoked, batched, streamed, or
transformed.
Attributes
InputType
OutputType
input_schema
output_schema
Methods
__init__()
abatch(inputs[, config, return_exceptions])
Default implementation of abatch, which calls ainvoke N times.
ainvoke(input[, config])
Default implementation of ainvoke, which calls invoke in a thread pool.
astream(input[, config])
Default implementation of astream, which calls ainvoke.
astream_log(input[, config, include_names, ...])
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 of batch, which calls invoke N times.
bind(**kwargs)
Bind arguments to a Runnable, returning a new Runnable.
invoke(input[, config])
map()
Return a new Runnable that maps a list of inputs to a list of outputs, by calling invoke() with each input.
stream(input[, config])
Default implementation of stream, which calls invoke.
transform(input[, config])
Default implementation of transform, which buffers input and then calls stream.
with_config([config])
Bind config to a Runnable, returning a new Runnable.
with_fallbacks(fallbacks, *[, ...])
with_retry(*[, retry_if_exception_type, ...])
__init__()¶