{ columns, rows } Data structure used by Graphy agents and chart configs. The format is auto-detected from the file extension.
fromFile
Signature
FileParseOptions combines spreadsheet options with the hasHeader flag from delimited parsing.
Options
string
required
Path to the file. The extension determines the format.
boolean
default:"true"
Whether the first row contains column headers (CSV/TSV only). When
false,
columns are auto-named Column 1, Column 2, etc.string | number
default:"0"
Sheet to parse (spreadsheets only). Pass a sheet name or 0-based index.
VizLocale
default:"EN_US"
Locale for number parsing. Determines thousand/decimal separator conventions.
number
default:"5"
Maximum allowed input size in megabytes. Throws an error if the input exceeds this limit.
number
default:"100000"
Maximum number of data rows to process (spreadsheets only).
number
default:"5000000"
Maximum total cells to process (spreadsheets only).
Supported Extensions
Unsupported extensions throw an error listing the supported formats.
Examples
With the AI SDK
Error Handling
fromFile uses Node.js fs.readFile under the hood and is not available in
the browser. For browser usage, use the format-specific parsers (fromCSV,
fromXLSX, etc.) after reading the file with the File API.
