Nodes/ComfyUI Griptape Nodes/Griptape Code: Run Python [DEPRECATED]
ComfyUI Node

Griptape Code: Run Python [DEPRECATED]

Executes python code as a task. The code takes the `input` from the task and should define an `output` variable that will be returned as the task's output.

By griptape-ai·Created 2 years ago·Updated about a year ago· 238
Griptape Code: Run Python [DEPRECATED]
  • agent
  • OUTPUT
  • AGENT
inputThis text will be passed as `input` to the code.
examplesCustom code
code# Python code to execute. # `input` is any input text. # `output` will be returned as the task output output = input.upper()
CategoryGriptape/Code

Inputs (4)

NameTypeDefaultDescription
inputSTRINGThis text will be passed as `input` to the code.
agentoptAGENT
examplesoptCOMBOCustom codeSelect an example code snippet to replace the default code.
codeoptSTRING# Python code to execute. # `input` is any input text. # `output` will be returned as the task output output = input.upper() Python code to execute. The code should define an `output` variable that will be returned as the task's output. Example: # Sorts a list of numbers def sort_numbers(numbers): return sorted(numbers) output = str(sort_numbers([int(x) for x in input.split(',')]))

Outputs (2)

NameTypeDescription
OUTPUTSTRING
AGENTAGENT