Introduction
Execute custom code within your AI workflows
Overview
The Code Runner is a powerful block type in Hunch that allows users to execute custom code as part of their AI workflows. It bridges the gap between AI-generated content and programmatic actions, enabling more complex and dynamic interactions within your canvas.
What is a Code Runner?
A Code Runner block is a specialized component that can execute arbitrary Python or Bash code within a secure sandbox environment. It allows users to:
- Process data from other blocks
- Perform calculations or data transformations
- Interact with external APIs or services
- Generate dynamic content or files
Code Runners expand the capabilities of your Hunch canvas beyond what’s possible with standard AI blocks alone, allowing for true programmatic control and customization.
Key Features
- Language Support: Execute Python or Bash code directly within your workflow.
- Secure Execution: Code runs in an isolated sandbox environment for safety.
- Input Integration: Easily access data from connected input blocks.
- Output Flexibility: Generate text, files, or other data types as output.
- Package Management: Install and use Python packages as needed.
The Power of Code in AI Workflows
By incorporating Code Runners, Hunch enables a seamless blend of AI capabilities and traditional programming. This combination allows for more sophisticated, flexible, and powerful workflows that can adapt to a wide range of use cases and requirements.
Whether you’re a seasoned developer or just getting started with coding, Code Runners provide a flexible and powerful tool to enhance your AI-driven projects in Hunch.