Understanding and handling Chains errors
run_remote
of a
Chainlet named TextToNum
and this in turn invokes TextReplicator
. The
respective run_remote
methods might also use other helper functions that
appear in the call stack.
Below is an example stack trace that shows how the root cause (a
ValueError
) is propagated up to the entrypoint’s run_remote
method (this
is what you would see as an error log):
ValueError
) always work.torch
) can be only raised
in the caller if they are included in the dependencies of the caller as
well. If the exception class cannot be resolved, a
GenericRemoteException
is raised instead.depends
can be configured with additional
options for that.
Below example shows how you can add automatic retries and error handling for
the call to TextReplicator
in TextToNum
:
run_remote
(and user implemented helper functions). Under the
hood, the calls from one Chainlet to another go through an HTTP
connection, managed by the Chains framework. And each Chainlet itself is
run as a FastAPI server with several layers of request handling code “above”.
In order to provide concise, readable stacks, all of this non-user code is
filtered out.