Skip to content

AI-assisted scripts

The AI pipeline helper can draft a processing script from a plain-language description and the block's declared ports. The generated script is an unreviewed starting point, not a validated scientific result.

Write a useful prompt

Describe:

  • the meaning of each input;
  • required column names and types;
  • filtering and missing-value behavior;
  • grouping keys and calculations;
  • expected output columns or JSON shape; and
  • the processing library to use when you have a preference.

Example:

Read the rows Arrow table. Require sample_id, measured_at, and od600. Remove rows where od600 is missing or negative. Using PyArrow, group by sample_id and calculate the mean, standard deviation, and count. Publish the Arrow table to summary and log the output row count.

Naming the library is especially helpful for grouping operations:

  • PyArrow and Polars use group_by.
  • pandas uses groupby.
  • dplyr uses group_by.
  • groupBy is not valid in these libraries.

Review the draft

Before applying the script, verify that it:

  1. imports or sources the FlaskTrack SDK once;
  2. reads every declared input with the correct helper;
  3. uses each literal port name exactly as declared;
  4. uses one dataframe library consistently;
  5. validates required columns or JSON keys;
  6. implements the intended units, statistics, and missing-value behavior;
  7. publishes every declared output with the correct helper; and
  8. does not access the network, credentials, or undeclared files.

Common generation mistakes

Mistake Correction
frame.groupBy(...) in Python Use the exact method for PyArrow, Polars, or pandas
Reads "row" when the port is "rows" Use the literal declared port name
Calls input_json for an Arrow table port Use input_table
Writes a file but never calls an output helper Publish it with output_file or another file-output helper
Mixes pandas expressions with a Polars dataframe Choose one dataframe library
Catches every error and publishes an empty result Allow the block to fail with a clear message

Test generated scripts

Use representative data and review the full result—not only whether the run completed. Compare key values against a small hand-calculated example whenever the script performs scientific or statistical calculations.