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
rowsArrow table. Requiresample_id,measured_at, andod600. Remove rows whereod600is missing or negative. Using PyArrow, group bysample_idand calculate the mean, standard deviation, and count. Publish the Arrow table tosummaryand 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. groupByis not valid in these libraries.
Review the draft
Before applying the script, verify that it:
- imports or sources the FlaskTrack SDK once;
- reads every declared input with the correct helper;
- uses each literal port name exactly as declared;
- uses one dataframe library consistently;
- validates required columns or JSON keys;
- implements the intended units, statistics, and missing-value behavior;
- publishes every declared output with the correct helper; and
- 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.