Reference
Box

Box (opens in a new tab) combines multiple values into a single output. It accepts a dictionary as input, and simply returns the evaluated dictionary – including the result of any future references.

Python
TypeScript

from substrate import Substrate, ComputeText, Box
story = ComputeText(prompt="tell me a story")
summary = ComputeText(prompt=sb.concat("summarize this: ", story.future.text))
box = Box(
value={
"story": story.future.text,
"summary": summary.future.text,
}
)
res = substrate.run(box)

This example shows how Box can be used to combine multiple node outputs into a single result at the end of a graph – but Box can also be used to combine outputs in the middle of a graph.