Step Decorator
The step decorator will create and send a step to the UI 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.
Parameters
The name of the step. Default to the name of the decorated function.
The type of the step, useful for monitoring and debugging.
By default the feedback buttons are disabled for steps. Set this to False
to
enable them.
By default the step will be nested under the previous step/message. Set this
to True
to make it a root step.
Language of the output. See https://react-code-blocks-rajinwonderland.vercel.app/?path=/story/codeblock—supported-languages for a list of supported languages.
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.
Access the Current step
You can access the current step object using cl.context.current_step
and override values.
Stream the Output
Nest Steps
If another step decorated function is called inside the decorated function, the child step will be nested under the parent step.
Was this page helpful?