Set input to be duck-typed if not set

Rather than default to a byte array, use some logic to try and guess the input format.