for now you can use os.environ.get("IDA_IS_INTERACTIVE")=="1".
os.environ.get("IDA_IS_INTERACTIVE")=="1"