call_chain.py
How to pass chain input
The data schema of the inference request corresponds to the function signature ofrun_remote()
in your entrypoint Chainlet.
For example, for the Hello Chain, HelloAll.run_remote()
:
run_remote.
Async chain inference
Like Truss models, Chains support async invocation. The guide for models applies largely - in particular for how to wrap the input and set up the webhook to process results. The following additional points are chains specific:- Use chain-based URLS:
https://chain-{chain}.api.baseten.co/production/async_run_remote
https://chain-{chain}.api.baseten.co/development/async_run_remote
https://chain-{chain}.api.baseten.co/deployment/{deployment}/async_run_remote
.https://chain-{chain}.api.baseten.co/environments/{env_name}/async_run_remote
.
- Only the entrypoint is invoked asynchronously. Internal Chainlet-Chainlet calls run synchronously.