The step decorator will log steps based on the decorated function. By default, the arguments of the function will be used as the input of the step and the return value will be used as the output.Under the hood, the step decorator is using the cl.Step class.
By default only the output of the step is shown. Set this to True to also
show the input. You can also set this to a language like json or python to
syntax highlight the input.
You can access the current step object using cl.context.current_step and override values.
Copy
import chainlit as cl@cl.stepasync def my_step(): current_step = cl.context.current_step # Override the input of the step current_step.input = "My custom input" # Override the output of the step current_step.output = "My custom output"