baml.io.input
Reads a line of text from stdin. If `prompt` is provided, it is printed first (without a newline).
Reference version
Signature
Reads a line of text from stdin. If prompt is provided, it is printed first (without a newline).
The trailing newline is stripped; end-of-input reads as "".
Unlike the print family — which panics with baml.panics.HostUnavailable
on a dead output stream, as Rust's println! does — reading input is an
operation callers routinely want to handle, so a failed read is an error
value.
Throws
Ioif the prompt cannot be written or stdin cannot be read.
Source:<builtin>/baml/ns_io/io.bamlbytes 515–604