AI Code
This document explains the AI Code node, which translates natural language instructions into executable code using an AI model.
Node Inputs
Required Fields
Instructions:
Detailed instructions specifying the code task to perform. Instructions can include dynamic variables ({{myVariable}}
) for customization.
Example: "Write a Python function to calculate the factorial of a number."
Optional Fields
Input Data 1:
Optional input data to be used in code generation.
Example: "Sample JSON data to parse."
Input Data 2:
Additional input data to supplement the instructions.
Example: "Desired output format as CSV."
Node AI Settings
Model:
The AI model used for code generation.
Example: "OPENAI - gpt-4o-2024-05-13"
Temperature:
Controls randomness in generated code:
- Lower values (e.g.,
0.2
) for deterministic outputs. - Higher values (e.g.,
0.8
) for creative or exploratory code.
Max Output Tokens:
Specifies the maximum token count for the generated code.
Example: 1000
Node Output
Output:
Generated code based on the provided instructions and optional input data.
Example Output:
Node Functionality
The AI Code node:
- Converts natural language prompts into code in a specified programming language.
- Supports integration of additional input data for dynamic or contextual code generation.
- Provides control over model creativity and response length through adjustable settings.
- Produces executable code ready for deployment or further refinement.