Skip to main content

Writing Code with AI

Superblocks offers versatile AI tools that provide the ability to generate, edit, and explain code, as well as generate mock data and 3rd party API calls. They can be seamlessly integrated into Applications, APIs, Workflows, and Scheduled Jobs. Creators can utilize the tools by clicking on the light bulb icon or using the CMD+I keyboard shortcut (or Ctrl+I on Windows machines). They support multiple programming languages such as JavaScript, Python, SQL, JSON, HTML, and more. The generated code snippets can be easily customized to fit specific requirements, while the concise explanations provide insights into code functionality. Additionally, the mock data generation feature aids developers in iterating on their APIs by generating personalized placeholder data for realistic testing scenarios. Empower your development process with efficient code generation, explanation, and mock data and step generation capabilities.

Generate

Generate Code

Generate code is a powerful tool that writes code for you in various programming languages, including JavaScript, Python, SQL, JSON, HTML, and more. This feature is especially useful for developers who may not be familiar with a particular language or require assistance in writing boilerplate code. The generated code can be easily modified and adapted to suit the creator’s specific requirements.

To leverage the code generation capability in any field, including component property fields, code editors, and step configuration fields, simply provide a prompt or description of the desired code, and the code snippets will be generated for you. Additionally, SQL generation utilizes the underlying schema to improve the quality of the response.

Furthermore, the AI streams in the response, allowing you to inspect and edit the generated code before inserting it into the desired field. This flexibility empowers you to make any necessary modifications to the code based on your project's unique needs.

Let AI assist you in writing code efficiently and effectively across various programming languages, enabling you to focus on solving problems and building applications.

Generate 3rd party API calls

Generate 3rd party API calls is a powerful feature designed to streamline the process of building applications with REST API or GraphQL steps. This feature is particularly valuable for developers when interacting with third-party services, such as Salesforce, Google APIs, or others.

To leverage API call generation, provide a prompt or description of the desired action you'd like your application to execute. For example, if you want to generate a call to Salesforce to list opportunities by revenue, simply describe this in the prompt. The AI will interpret your request, automatically generating the correct call to Salesforce with the appropriate endpoint, parameters, headers, and body.

This feature takes into account the specificities and conventions of various APIs, saving you valuable time researching how to correctly call each API. It fills in the necessary fields for the API or GraphQL step in your workflow, reducing the potential for errors and streamlining your development process.

By utilizing the API call generation feature, you can efficiently generate and insert complex API calls into your applications, enabling you to focus more on logic and less on manual coding. This capability significantly enhances productivity, making your API interactions seamless and straightforward, and accelerating your overall development timeline.

Experience the power of AI with the API call generation feature and let it navigate your application's interaction with third-party services.

Generate Mock Data

The Generate Mock Data feature enables users to generate personalized mock data for various purposes, such as populating Tables, Grids, Chat interfaces, iFrames, and more. This functionality proves especially beneficial when users are in the iterative phase of their API development and require realistic placeholder data.

With the Mock feature, users can quickly generate mock data that closely resembles the structure and format of their actual data. This allows them to simulate real-world scenarios and test their applications with representative datasets. By generating personalized mock data, users can iterate on their API implementation efficiently, ensuring seamless integration and smooth functionality.

The Mock feature complements the code generation capabilities, enabling developers to not only generate code snippets but also populate their applications with realistic mock data. This combination accelerates the development process and facilitates robust testing, leading to more reliable and high-quality applications.

Leverage the Mock feature to generate personalized mock data, ensuring a smooth and efficient API development process.

Edit

The Edit feature allows users to make alterations to their existing code by highlighting it. Users will be able to see an inline diff view in their preview. This functionality will make it easy to compare changes and keep track of modifications made to the code.

Make the most of your development process by leveraging the editing capabilities.

Explain

The Explain feature provides a concise explanation for a given code snippet. Similar to generate, you can use explain in various contexts, such as component property fields, code editors, and step configuration fields. When you highlight a specific code snippet, the explanation will center around that highlighted code, offering valuable insights.

By utilizing the explain function, you can quickly understand the purpose, functionality, or potential issues within your code without the need for verbose explanations. The AI aims to provide clear and concise explanations that help you gain a deeper understanding of your code and its implications.

Empower yourself with the Explain function to enhance your code comprehension and streamline your development process.