Morph AI’s code generation feature generates initial code from plain-text prompts when creating SQL and Python files. This feature is only available from the Canvas.

The information that can be specified during generation for each language is as follows:

SQL

  • Table: Generates SQL tailored to the database of the specified table.
  • SQL or Python Result (only the result is a DataFrame): Generates SQL using DuckDB by specifying the aggregation results in the FROM clause or JOIN clause.

You can use multiple tables or multiple aggregation results, but you cannot specify both tables and aggregation results at the same time.

Python

  • Integration: Generates Python code using the API or SDK of the SaaS associated with the specified Integration.
  • SQL or Python Result: Loads the aggregation results with @morph.load_data() to generate Python code.