Cortex
TwitterDiscord
  • 👋Welcome to Cortex
  • Overview
    • 💡Understanding Cortex Architecture
  • Product Guides
    • 🛫Making your first Copilot
    • ⚡Making your first Callable
  • Fundamentals
    • ✈️Copilot
    • 🧠Knowledge
    • ⚡Callable
    • 🛠️Getting set up
      • 📝Setting permissions
  • Callable
    • Blocks
      • Models
        • Language Model
        • Language Model With Code
      • Data
        • Dataset Loader
      • Tools
        • Knowledge Search
        • Google Search
        • Curl Request
        • Web Page Crawler
      • Control
        • Code
        • Loop Until
        • Map Reduce
    • Use Cases
      • Building a Company Help Desk
      • Creating a Social Media Manager Chatbot
      • Utilizing Model Examples to Convert Text to JSON
      • Retrievals from Knowledge Search Blocks
      • Chatbot with Google Search Assistance
  • Guides
    • Getting Started with the SDK
    • Documents
  • API References
    • Introduction
    • Authentication
    • Making Curl Requests
    • Node.js Library
    • Python Library
Powered by GitBook
On this page
  1. Callable
  2. Blocks
  3. Control

Code

PreviousControlNextLoop Until

Last updated 1 year ago

Code blocks allow for users to execute JavaScript code in a Callable

The env variable passed into the function allows for referencing previous block outputs inside the Code Block. It uses the syntax env.state.BLOCK_NAME to reference a block by its name. In the example above, the block name for the code block would be CODE_1. User's can name blocks anything as long as it is unique inside the Callable.